Resolve conflicts

This commit is contained in:
syuilo 2018-03-29 14:48:47 +09:00
parent 281b388e39
commit bfc193d8cd
308 changed files with 3045 additions and 3200 deletions

View file

@ -9,7 +9,7 @@ export default Notification;
export interface INotification {
_id: mongo.ObjectID;
created_at: Date;
createdAt: Date;
/**
*
@ -19,7 +19,7 @@ export interface INotification {
/**
*
*/
notifiee_id: mongo.ObjectID;
notifieeId: mongo.ObjectID;
/**
* (initiator)Origin
@ -29,7 +29,7 @@ export interface INotification {
/**
* (initiator)Origin
*/
notifier_id: mongo.ObjectID;
notifierId: mongo.ObjectID;
/**
*
@ -46,7 +46,7 @@ export interface INotification {
/**
*
*/
is_read: Boolean;
isRead: Boolean;
}
/**
@ -75,15 +75,15 @@ export const pack = (notification: any) => new Promise<any>(async (resolve, reje
_notification.id = _notification._id;
delete _notification._id;
// Rename notifier_id to user_id
_notification.user_id = _notification.notifier_id;
delete _notification.notifier_id;
// Rename notifierId to userId
_notification.userId = _notification.notifierId;
delete _notification.notifierId;
const me = _notification.notifiee_id;
delete _notification.notifiee_id;
const me = _notification.notifieeId;
delete _notification.notifieeId;
// Populate notifier
_notification.user = await packUser(_notification.user_id, me);
_notification.user = await packUser(_notification.userId, me);
switch (_notification.type) {
case 'follow':
@ -96,7 +96,7 @@ export const pack = (notification: any) => new Promise<any>(async (resolve, reje
case 'reaction':
case 'poll_vote':
// Populate post
_notification.post = await packPost(_notification.post_id, me);
_notification.post = await packPost(_notification.postId, me);
break;
default:
console.error(`Unknown type: ${_notification.type}`);