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.

18 lines
503 B

  1. import { AnnotationRepository } from '@/domain/models/tasks/annotationRepository'
  2. import { Category } from '@/domain/models/tasks/category'
  3. export class APICategoryRepository extends AnnotationRepository<Category> {
  4. labelName = 'categories'
  5. toModel(item: { [key: string]: any }): Category {
  6. return new Category(item.id, item.label, item.user)
  7. }
  8. toPayload(item: Category): { [key: string]: any } {
  9. return {
  10. id: item.id,
  11. label: item.label,
  12. user: item.user
  13. }
  14. }
  15. }