mirror of
https://github.com/gromlab-ru/slm-design.git
synced 2026-08-22 07:30:16 +03:00
17 lines
445 B
TypeScript
17 lines
445 B
TypeScript
import type { SimpleUserDto } from '@/infra/simple-rest-api'
|
|
|
|
import type { AuthUser } from '../types/auth-user.type'
|
|
|
|
/**
|
|
* Переводит внешний user DTO в модель auth-домена.
|
|
*/
|
|
export const mapAuthUser = (user: SimpleUserDto): AuthUser => {
|
|
return {
|
|
id: user.id,
|
|
email: user.email,
|
|
name: user.name,
|
|
role: user.role,
|
|
avatarUrl: typeof user.avatarUrl === 'string' ? user.avatarUrl : null
|
|
}
|
|
}
|