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 UserNotification from "./UserNotification";
import User from "./User";
export default class Notification extends Resource {
uid?: string;
message: string;
redirection_url: string;
created_at: Date | null;
updated_at: Date | null;
user?: User[];
userNotification?: UserNotification;
}

View File

@ -16,6 +16,7 @@ const class_validator_1 = require("class-validator");
const Resource_1 = __importDefault(require("../Resource"));
const class_transformer_1 = require("class-transformer");
const UserNotification_1 = __importDefault(require("./UserNotification"));
const User_1 = __importDefault(require("./User"));
class Notification extends Resource_1.default {
constructor() {
super(...arguments);
@ -46,6 +47,11 @@ __decorate([
(0, class_validator_1.IsDate)(),
__metadata("design:type", Object)
], 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([
(0, class_transformer_1.Expose)(),
(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 { Expose, Type } from "class-transformer";
import UserNotification from "./UserNotification";
import User from "./User";
export default class Notification extends Resource {
@Expose()
@ -22,6 +23,10 @@ export default class Notification extends Resource {
@IsDate()
public updated_at: Date | null = null;
@Expose()
@Type(() => User)
public user?: User[];
@Expose()
@Type(() => UserNotification)
public userNotification?: UserNotification;