running now
This commit is contained in:
parent
85cd083750
commit
c17bb05f0a
25 changed files with 156 additions and 114 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { AbstractDto } from "../dtos/AbstractDto";
|
||||
import { AbstractEntity } from "../entities/AbstractEntity";
|
||||
import { AbstractDto } from "../dtos/AbstractDto.js";
|
||||
import { AbstractEntity } from "../entities/AbstractEntity.js";
|
||||
|
||||
export abstract class AbstractDtoEntityMapper<
|
||||
E extends AbstractEntity,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { AbstractDtoEntityMapper } from "./AbstractDtoEntityMapper";
|
||||
import { UserEntity } from "../entities/UserEntity";
|
||||
import { UserDto } from "../dtos/UserDto";
|
||||
import { AbstractDtoEntityMapper } from "./AbstractDtoEntityMapper.js";
|
||||
import { UserEntity } from "../entities/UserEntity.js";
|
||||
import { UserDto } from "../dtos/UserDto.js";
|
||||
import { ValidationError } from "../errors/httpErrors.js";
|
||||
|
||||
export class UserDtoEntityMapper extends AbstractDtoEntityMapper<UserEntity, UserDto> {
|
||||
toDto(entity: UserEntity): UserDto {
|
||||
|
|
@ -22,10 +23,11 @@ export class UserDtoEntityMapper extends AbstractDtoEntityMapper<UserEntity, Use
|
|||
|
||||
entity.userName = dto.userName;
|
||||
entity.email = dto.email;
|
||||
// ⚠️ Don’t forget password handling — usually set elsewhere, not exposed in DTO
|
||||
entity.firstName = dto.firstName;
|
||||
entity.lastName = dto.lastName;
|
||||
entity.role = dto.role;
|
||||
if(dto.role){
|
||||
entity.role = dto.role;
|
||||
}
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue