Added timestamp to notifications

This commit is contained in:
Isaac Abadi
2022-11-27 12:11:04 -05:00
parent 0efbd11d29
commit ac808fcabe
3 changed files with 6 additions and 1 deletions

View File

@@ -2761,6 +2761,7 @@ components:
- type
- text
- read
- timestamp
type: object
properties:
type:
@@ -2777,6 +2778,8 @@ components:
type: boolean
data:
type: object
timestamp:
type: number
NotificationAction:
type: string
enum:

View File

@@ -26,7 +26,8 @@ exports.createNotification = (type, actions, data, user_uid) => {
data: data,
user_uid: user_uid,
uid: uuid(),
read: false
read: false,
timestamp: Date.now()/1000
}
return notification;
}

View File

@@ -12,4 +12,5 @@ export type Notification = {
action?: Array<NotificationAction>;
read: boolean;
data?: any;
timestamp: number;
};