mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-01-15 01:14:27 -05:00
fix: add public userDTO to prevent confusion
This commit is contained in:
parent
43299522ee
commit
0efd2d8bf9
2 changed files with 7 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
import { Expose, plainToClass, Type } from "class-transformer";
|
import { Expose, plainToClass, Type } from "class-transformer";
|
||||||
import { AuthSignInDTO } from "src/auth/dto/authSignIn.dto";
|
|
||||||
import { FileDTO } from "src/file/dto/file.dto";
|
import { FileDTO } from "src/file/dto/file.dto";
|
||||||
|
import { PublicUserDTO } from "src/user/dto/publicUser.dto";
|
||||||
|
|
||||||
export class ShareDTO {
|
export class ShareDTO {
|
||||||
@Expose()
|
@Expose()
|
||||||
|
@ -14,8 +14,8 @@ export class ShareDTO {
|
||||||
files: FileDTO[];
|
files: FileDTO[];
|
||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
@Type(() => AuthSignInDTO)
|
@Type(() => PublicUserDTO)
|
||||||
creator: AuthSignInDTO;
|
creator: PublicUserDTO;
|
||||||
|
|
||||||
from(partial: Partial<ShareDTO>) {
|
from(partial: Partial<ShareDTO>) {
|
||||||
return plainToClass(ShareDTO, partial, { excludeExtraneousValues: true });
|
return plainToClass(ShareDTO, partial, { excludeExtraneousValues: true });
|
||||||
|
|
4
backend/src/user/dto/publicUser.dto.ts
Normal file
4
backend/src/user/dto/publicUser.dto.ts
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
import { PickType } from "@nestjs/swagger";
|
||||||
|
import { UserDTO } from "./user.dto";
|
||||||
|
|
||||||
|
export class PublicUserDTO extends PickType(UserDTO, ["email"] as const) {}
|
Loading…
Add table
Reference in a new issue