From 134f2bd945bd715d344d51d92089c03f9a67e6ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6ninger?= <44400490+p-hoeni@users.noreply.github.com> Date: Tue, 29 Oct 2024 21:30:20 +0100 Subject: [PATCH] [#24] enhance file-item model with possible nested file-items --- .../src/app/file-items/shared/models/file-item.model.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CLIENT/CLIENT.FileSharing/src/app/file-items/shared/models/file-item.model.ts b/CLIENT/CLIENT.FileSharing/src/app/file-items/shared/models/file-item.model.ts index 4af377b..c32dfce 100644 --- a/CLIENT/CLIENT.FileSharing/src/app/file-items/shared/models/file-item.model.ts +++ b/CLIENT/CLIENT.FileSharing/src/app/file-items/shared/models/file-item.model.ts @@ -1,5 +1,5 @@ import 'reflect-metadata'; -import { jsonObject, jsonMember } from 'typedjson'; +import { jsonObject, jsonMember, jsonArrayMember } from 'typedjson'; @jsonObject export class FileItem { @@ -21,6 +21,9 @@ export class FileItem { @jsonMember fileSize?: number; + @jsonArrayMember(FileItem) + fileItems?: { $id: number; $values: FileItem[] }; + constructor( pId: number, pName: string, @@ -28,6 +31,7 @@ export class FileItem { pLastChanged: Date, pIsFolder = false, pFileSize?: number, + fileItems?: { $id: number; $values: FileItem[] }, ) { this.id = pId; this.name = pName; @@ -35,5 +39,6 @@ export class FileItem { this.lastChanged = pLastChanged; this.isFolder = pIsFolder; this.fileSize = pFileSize; + this.fileItems = fileItems; } }