chore : remove class-transformer
This commit is contained in:
@@ -1,16 +1,13 @@
|
|||||||
import { Expose } from 'class-transformer';
|
|
||||||
|
|
||||||
export class UserResponseDTO {
|
export class UserResponseDTO {
|
||||||
constructor(partial: Partial<UserResponseDTO>) {
|
constructor(partial: Partial<UserResponseDTO>) {
|
||||||
Object.assign(this, partial);
|
Object.assign(this, partial);
|
||||||
this.id = partial.id;
|
|
||||||
}
|
}
|
||||||
@Expose()
|
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
@Expose()
|
|
||||||
username: string;
|
username: string;
|
||||||
|
|
||||||
@Expose()
|
|
||||||
avatar: string;
|
avatar: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
import { Expose } from 'class-transformer';
|
|
||||||
|
|
||||||
export class WordResponseDTO {
|
export class WordResponseDTO {
|
||||||
constructor(partial: Partial<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;
|
id: number;
|
||||||
|
|
||||||
@Expose()
|
|
||||||
value: string;
|
value: string;
|
||||||
|
|
||||||
@Expose()
|
|
||||||
ownerId: string;
|
ownerId: string;
|
||||||
|
|
||||||
@Expose()
|
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
|
|
||||||
|
toJSON() {
|
||||||
|
return { ...this } // here I make a POJO's copy of the class instance
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user