mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
Moved markPMSRead to common.ops. Added tests
This commit is contained in:
14
common/script/ops/markPMSRead.js
Normal file
14
common/script/ops/markPMSRead.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import i18n from '../i18n';
|
||||
|
||||
module.exports = function markPmsRead (user, req = {}) {
|
||||
user.inbox.newMessages = 0;
|
||||
|
||||
if (req.v2 === true) {
|
||||
return user;
|
||||
} else {
|
||||
return [
|
||||
user.inbox.newMessages,
|
||||
i18n.t('pmsMarkedRead'),
|
||||
];
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user