Browse Source

Add clear method to the annotation repository

pull/1251/head
Hironsan 4 years ago
parent
commit
7a60fc51c3
2 changed files with 7 additions and 0 deletions
  1. 5
      frontend/repositories/tasks/text-classification/api.ts
  2. 2
      frontend/repositories/tasks/text-classification/interface.ts

5
frontend/repositories/tasks/text-classification/api.ts

@ -25,4 +25,9 @@ export class FromApiTextClassificationRepository implements TextClassificationRe
const url = `/projects/${projectId}/docs/${docId}/annotations/${annotationId}`
await this.request.delete(url)
}
public async clear(projectId: string, docId: number): Promise<void> {
const url = `/projects/${projectId}/docs/${docId}/annotations`
await this.request.delete(url)
}
}

2
frontend/repositories/tasks/text-classification/interface.ts

@ -6,4 +6,6 @@ export interface TextClassificationRepository {
create(projectId: string, docId: number, labelId: number): Promise<void>
delete(projectId: string, docId: number, annotationId: number): Promise<void>
clear(projectId: string, docId: number): Promise<void>
}
Loading…
Cancel
Save