mirror of
https://github.com/gromlab-ru/slm-design.git
synced 2026-08-22 07:30:16 +03:00
feat: add example
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user