Moved markPMSRead to common.ops. Added tests

This commit is contained in:
Keith Holliday
2016-05-09 09:02:55 -05:00
parent c88cae4ddb
commit a92359e119
8 changed files with 47 additions and 11 deletions

View 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'),
];
}
};