Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(notification-service): adds actionMeta property to NotificationUser model #99

Merged
merged 4 commits into from
Dec 7, 2020
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import {model, property, belongsTo} from '@loopback/repository';
import {model, property, belongsTo, AnyObject} from '@loopback/repository';
import {BaseEntity} from '@sourceloop/core';
import {Notification} from './notification.model';

@model({
name: 'notification_users',
settings: {
strict: false,
}
})
export class NotificationUser extends BaseEntity {
@property({
Expand Down Expand Up @@ -36,6 +39,20 @@ export class NotificationUser extends BaseEntity {
})
isRead?: boolean;

@property({
type: 'object',
required: false,
name: 'action_meta',
})
actionMeta?: AnyObject;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can u also add dynamic props like this -

? This will allow others to send anything extra easily

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also need to specify strict mode as false in @model() decorator fn. check in same class

// Define well-known properties here

// Indexer property to allow additional data
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[prop: string]: any;


constructor(data?: Partial<NotificationUser>) {
super(data);
}
Expand Down