mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-17 04:33:15 +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 { 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) {}
|
||||||
Reference in New Issue
Block a user