|
123456789101112131415161718192021 |
- import Folder from './Folder'
-
- export default class User {
- id?: string
- name: string
- rootFolder: Folder
- createdAt: Date
- updatedAt: Date
- deletedAt?: Date
-
- static resolve(data: Record<string, unknown>): User {
- return {
- id: data['id'] as string,
- name: data['name'] as string,
- rootFolder: { id: data['root_folder_id'] } as Folder,
- createdAt: new Date(data['created_at'] as string),
- updatedAt: new Date(data['updated_at'] as string),
- deletedAt: data['deleted_at'] ? new Date(data['deleted_at'] as string) : null,
- }
- }
- }
|