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.

19 lines
698 B

  1. import { AnnotationRepository } from '@/domain/models/tasks/annotationRepository'
  2. import { SequenceLabelingLabel } from '~/domain/models/tasks/sequenceLabeling'
  3. export class APISequenceLabelingRepository extends AnnotationRepository<SequenceLabelingLabel> {
  4. constructor() {
  5. super(SequenceLabelingLabel)
  6. }
  7. public async update(projectId: string, docId: number, annotationId: number, labelId: number) {
  8. const url = this.baseUrl(projectId, docId) + `/${annotationId}`
  9. const payload = { label: labelId }
  10. await this.request.patch(url, payload)
  11. }
  12. protected baseUrl(projectId: string, docId: number): string {
  13. return `/projects/${projectId}/examples/${docId}/spans`
  14. }
  15. }