Skip to content

Commit

Permalink
[#24] enhance file-item model with possible nested file-items
Browse files Browse the repository at this point in the history
  • Loading branch information
philipphoeninger committed Oct 29, 2024
1 parent 122a212 commit 134f2bd
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'reflect-metadata';
import { jsonObject, jsonMember } from 'typedjson';
import { jsonObject, jsonMember, jsonArrayMember } from 'typedjson';

@jsonObject
export class FileItem {
Expand All @@ -21,19 +21,24 @@ export class FileItem {
@jsonMember
fileSize?: number;

@jsonArrayMember(FileItem)
fileItems?: { $id: number; $values: FileItem[] };

constructor(
pId: number,
pName: string,
pCreatedAt: Date,
pLastChanged: Date,
pIsFolder = false,
pFileSize?: number,
fileItems?: { $id: number; $values: FileItem[] },
) {
this.id = pId;
this.name = pName;
this.createdAt = pCreatedAt;
this.lastChanged = pLastChanged;
this.isFolder = pIsFolder;
this.fileSize = pFileSize;
this.fileItems = fileItems;
}
}

0 comments on commit 134f2bd

Please sign in to comment.