Notification system enhanced
- Base for notifcation center - Show text in map if no data is available
This commit is contained in:
11
backend/models/notifications/notification.model.ts
Normal file
11
backend/models/notifications/notification.model.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Model, model } from 'mongoose';
|
||||
import { IUser } from '../user/user.interface';
|
||||
import { INotification, ISeverity, NotificationType } from './notification.interface';
|
||||
import { schemaNotification } from './notification.schema';
|
||||
|
||||
const modelNotification: Model<INotification> = model<INotification>('Notification', schemaNotification, 'Notification');
|
||||
export { modelNotification as Notification };
|
||||
|
||||
export function addNotification(type: NotificationType, severity: ISeverity, message: any, user: IUser) {
|
||||
return modelNotification.create({ type, severity, message, user });
|
||||
}
|
||||
Reference in New Issue
Block a user