feat: add example

This commit is contained in:
2026-08-01 09:31:08 +03:00
parent 15805e28df
commit 26b59686a5
434 changed files with 34975 additions and 4995 deletions

View File

@@ -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
}
}