fixed some saves

This commit is contained in:
Fredrik Friis 2012-03-01 12:45:07 +09:00
parent 10fba9cdcc
commit b2ae45a2c4
3 changed files with 3 additions and 3 deletions

@ -64,7 +64,7 @@ public class JsonDeletePrivateMessagePage extends WebPage {
if (userSettings.getApiKey() != null && userSettings.getApiKey().equals(apikey)) {
PrivateMessage privateMessage = privateMessageDao.load(jsonDeletePrivateMessage.id);
privateMessage.setDeleted(true);
privateMessageDao.save(privateMessage);
privateMessage = privateMessageDao.save(privateMessage);
jsonOutput.addProperty("apikey", "success");
} else {
jsonOutput.addProperty("apikey", "fail");

@ -60,7 +60,7 @@ public class JsonDeleteRecipientPage extends WebPage {
if (userSettings.getApiKey() != null && userSettings.getApiKey().equals(apikey)) {
Recipient recipient = recipientDao.load(jsonRecipient.id);
recipient.setDeleted(true);
recipientDao.save(recipient);
recipient = recipientDao.save(recipient);
jsonOutput.addProperty("apikey", "success");
} else {
jsonOutput.addProperty("apikey", "fail");

@ -61,7 +61,7 @@ public class JsonSetReadPage extends WebPage {
if (userSettings.getApiKey() != null && userSettings.getApiKey().equals(apikey)) {
Recipient recipient = recipientDao.load(jsonRecipient.id);
recipient.setDateRead(new Date());
recipientDao.save(recipient);
recipient = recipientDao.save(recipient);
jsonOutput.addProperty("apikey", "success");
} else {
jsonOutput.addProperty("apikey", "fail");