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)) {
|
if (userSettings.getApiKey() != null && userSettings.getApiKey().equals(apikey)) {
|
||||||
PrivateMessage privateMessage = privateMessageDao.load(jsonDeletePrivateMessage.id);
|
PrivateMessage privateMessage = privateMessageDao.load(jsonDeletePrivateMessage.id);
|
||||||
privateMessage.setDeleted(true);
|
privateMessage.setDeleted(true);
|
||||||
privateMessageDao.save(privateMessage);
|
privateMessage = privateMessageDao.save(privateMessage);
|
||||||
jsonOutput.addProperty("apikey", "success");
|
jsonOutput.addProperty("apikey", "success");
|
||||||
} else {
|
} else {
|
||||||
jsonOutput.addProperty("apikey", "fail");
|
jsonOutput.addProperty("apikey", "fail");
|
||||||
|
@ -60,7 +60,7 @@ public class JsonDeleteRecipientPage extends WebPage {
|
|||||||
if (userSettings.getApiKey() != null && userSettings.getApiKey().equals(apikey)) {
|
if (userSettings.getApiKey() != null && userSettings.getApiKey().equals(apikey)) {
|
||||||
Recipient recipient = recipientDao.load(jsonRecipient.id);
|
Recipient recipient = recipientDao.load(jsonRecipient.id);
|
||||||
recipient.setDeleted(true);
|
recipient.setDeleted(true);
|
||||||
recipientDao.save(recipient);
|
recipient = recipientDao.save(recipient);
|
||||||
jsonOutput.addProperty("apikey", "success");
|
jsonOutput.addProperty("apikey", "success");
|
||||||
} else {
|
} else {
|
||||||
jsonOutput.addProperty("apikey", "fail");
|
jsonOutput.addProperty("apikey", "fail");
|
||||||
|
@ -61,7 +61,7 @@ public class JsonSetReadPage extends WebPage {
|
|||||||
if (userSettings.getApiKey() != null && userSettings.getApiKey().equals(apikey)) {
|
if (userSettings.getApiKey() != null && userSettings.getApiKey().equals(apikey)) {
|
||||||
Recipient recipient = recipientDao.load(jsonRecipient.id);
|
Recipient recipient = recipientDao.load(jsonRecipient.id);
|
||||||
recipient.setDateRead(new Date());
|
recipient.setDateRead(new Date());
|
||||||
recipientDao.save(recipient);
|
recipient = recipientDao.save(recipient);
|
||||||
jsonOutput.addProperty("apikey", "success");
|
jsonOutput.addProperty("apikey", "success");
|
||||||
} else {
|
} else {
|
||||||
jsonOutput.addProperty("apikey", "fail");
|
jsonOutput.addProperty("apikey", "fail");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user