Discord bot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

User.ts 543 B

123456789101112131415161718192021
  1. import Folder from './Folder'
  2. export default class User {
  3. id?: string
  4. name: string
  5. rootFolder: Folder
  6. createdAt: Date
  7. updatedAt: Date
  8. deletedAt?: Date
  9. static resolve(data: Record<string, unknown>): User {
  10. return {
  11. id: data['id'] as string,
  12. name: data['name'] as string,
  13. rootFolder: { id: data['root_folder_id'] } as Folder,
  14. createdAt: new Date(data['created_at'] as string),
  15. updatedAt: new Date(data['updated_at'] as string),
  16. deletedAt: data['deleted_at'] ? new Date(data['deleted_at'] as string) : null,
  17. }
  18. }
  19. }