fixed some saves
This commit is contained in:
parent
10fba9cdcc
commit
b2ae45a2c4
src/main/java/se/su/dsv/scipro/json/pages
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user