summaryrefslogtreecommitdiff
path: root/src/api/common/notify.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2018-03-28 17:05:36 +0900
committerGitHub <noreply@github.com>2018-03-28 17:05:36 +0900
commit46e530ef41bb640cfa66438e888d1ecd6f90f6bb (patch)
treea23eefae5e437ad6adc7dfe190daba81138aa70b /src/api/common/notify.ts
parent#1294 (diff)
parentoops (diff)
downloadsharkey-46e530ef41bb640cfa66438e888d1ecd6f90f6bb.tar.gz
sharkey-46e530ef41bb640cfa66438e888d1ecd6f90f6bb.tar.bz2
sharkey-46e530ef41bb640cfa66438e888d1ecd6f90f6bb.zip
Merge pull request #1324 from syuilo/#1288-2
snake_case を camelCase にするなどした
Diffstat (limited to 'src/api/common/notify.ts')
-rw-r--r--src/api/common/notify.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/api/common/notify.ts b/src/api/common/notify.ts
index ae5669b84c..c4df17f880 100644
--- a/src/api/common/notify.ts
+++ b/src/api/common/notify.ts
@@ -16,11 +16,11 @@ export default (
// Create notification
const notification = await Notification.insert(Object.assign({
- created_at: new Date(),
- notifiee_id: notifiee,
- notifier_id: notifier,
+ createdAt: new Date(),
+ notifieeId: notifiee,
+ notifierId: notifier,
type: type,
- is_read: false
+ isRead: false
}, content));
resolve(notification);
@@ -31,14 +31,14 @@ export default (
// 3秒経っても(今回作成した)通知が既読にならなかったら「未読の通知がありますよ」イベントを発行する
setTimeout(async () => {
- const fresh = await Notification.findOne({ _id: notification._id }, { is_read: true });
- if (!fresh.is_read) {
+ const fresh = await Notification.findOne({ _id: notification._id }, { isRead: true });
+ if (!fresh.isRead) {
//#region ただしミュートしているユーザーからの通知なら無視
const mute = await Mute.find({
- muter_id: notifiee,
- deleted_at: { $exists: false }
+ muterId: notifiee,
+ deletedAt: { $exists: false }
});
- const mutedUserIds = mute.map(m => m.mutee_id.toString());
+ const mutedUserIds = mute.map(m => m.muteeId.toString());
if (mutedUserIds.indexOf(notifier.toString()) != -1) {
return;
}