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
502 B

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