mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-11 10:27:01 +02:00
fix: add public userDTO to prevent confusion
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Expose, plainToClass, Type } from "class-transformer";
|
||||
import { AuthSignInDTO } from "src/auth/dto/authSignIn.dto";
|
||||
import { FileDTO } from "src/file/dto/file.dto";
|
||||
import { PublicUserDTO } from "src/user/dto/publicUser.dto";
|
||||
|
||||
export class ShareDTO {
|
||||
@Expose()
|
||||
@@ -14,8 +14,8 @@ export class ShareDTO {
|
||||
files: FileDTO[];
|
||||
|
||||
@Expose()
|
||||
@Type(() => AuthSignInDTO)
|
||||
creator: AuthSignInDTO;
|
||||
@Type(() => PublicUserDTO)
|
||||
creator: PublicUserDTO;
|
||||
|
||||
from(partial: Partial<ShareDTO>) {
|
||||
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) {}
|
||||
Reference in New Issue
Block a user