Added user list to notif

This commit is contained in:
Vins 2023-09-22 10:45:30 +02:00
parent 88de7c08e9
commit a779bdc76b
3 changed files with 13 additions and 0 deletions

View File

@ -1,10 +1,12 @@
import Resource from "../Resource"; import Resource from "../Resource";
import UserNotification from "./UserNotification"; import UserNotification from "./UserNotification";
import User from "./User";
export default class Notification extends Resource { export default class Notification extends Resource {
uid?: string; uid?: string;
message: string; message: string;
redirection_url: string; redirection_url: string;
created_at: Date | null; created_at: Date | null;
updated_at: Date | null; updated_at: Date | null;
user?: User[];
userNotification?: UserNotification; userNotification?: UserNotification;
} }

View File

@ -16,6 +16,7 @@ const class_validator_1 = require("class-validator");
const Resource_1 = __importDefault(require("../Resource")); const Resource_1 = __importDefault(require("../Resource"));
const class_transformer_1 = require("class-transformer"); const class_transformer_1 = require("class-transformer");
const UserNotification_1 = __importDefault(require("./UserNotification")); const UserNotification_1 = __importDefault(require("./UserNotification"));
const User_1 = __importDefault(require("./User"));
class Notification extends Resource_1.default { class Notification extends Resource_1.default {
constructor() { constructor() {
super(...arguments); super(...arguments);
@ -46,6 +47,11 @@ __decorate([
(0, class_validator_1.IsDate)(), (0, class_validator_1.IsDate)(),
__metadata("design:type", Object) __metadata("design:type", Object)
], Notification.prototype, "updated_at", void 0); ], Notification.prototype, "updated_at", void 0);
__decorate([
(0, class_transformer_1.Expose)(),
(0, class_transformer_1.Type)(() => User_1.default),
__metadata("design:type", Array)
], Notification.prototype, "user", void 0);
__decorate([ __decorate([
(0, class_transformer_1.Expose)(), (0, class_transformer_1.Expose)(),
(0, class_transformer_1.Type)(() => UserNotification_1.default), (0, class_transformer_1.Type)(() => UserNotification_1.default),

View File

@ -2,6 +2,7 @@ import { IsDate, IsUrl } from "class-validator";
import Resource from "../Resource"; import Resource from "../Resource";
import { Expose, Type } from "class-transformer"; import { Expose, Type } from "class-transformer";
import UserNotification from "./UserNotification"; import UserNotification from "./UserNotification";
import User from "./User";
export default class Notification extends Resource { export default class Notification extends Resource {
@Expose() @Expose()
@ -22,6 +23,10 @@ export default class Notification extends Resource {
@IsDate() @IsDate()
public updated_at: Date | null = null; public updated_at: Date | null = null;
@Expose()
@Type(() => User)
public user?: User[];
@Expose() @Expose()
@Type(() => UserNotification) @Type(() => UserNotification)
public userNotification?: UserNotification; public userNotification?: UserNotification;