Compare commits

..
1 Commits
Author SHA1 Message Date
legonzaur fff2abf0a1 chore : remove class-transformer 2024-12-29 19:34:43 +01:00
2 changed files with 11 additions and 12 deletions
+2 -5
View File
@@ -1,16 +1,13 @@
import { Expose } from 'class-transformer';
export class UserResponseDTO {
constructor(partial: Partial<UserResponseDTO>) {
Object.assign(this, partial);
this.id = partial.id;
}
@Expose()
id: string;
@Expose()
username: string;
@Expose()
avatar: string;
}
+9 -7
View File
@@ -1,18 +1,20 @@
import { Expose } from 'class-transformer';
export class WordResponseDTO {
constructor(partial: Partial<WordResponseDTO>) {
Object.assign(this, partial);
if (partial.id) this.id = partial.id
if (partial.value) this.value = partial.value
if (partial.ownerId) this.ownerId = partial.ownerId
if (partial.enabled) this.enabled = partial.enabled
}
@Expose()
id: number;
@Expose()
value: string;
@Expose()
ownerId: string;
@Expose()
enabled: boolean;
toJSON() {
return { ...this } // here I make a POJO's copy of the class instance
}
}