mirror of https://github.com/doccano/doccano.git
Hironsan
1 year ago
10 changed files with 266 additions and 51 deletions
Unified View
Diff Options
-
28backend/examples/serializers.py
-
74frontend/components/example/AudioList.vue
-
74frontend/components/example/DocumentList.vue
-
74frontend/components/example/ImageList.vue
-
9frontend/domain/models/example/example.ts
-
29frontend/pages/projects/_id/dataset/index.vue
-
4frontend/plugins/repositories.ts
-
18frontend/repositories/example/apiAssignmentRepository.ts
-
3frontend/repositories/example/apiDocumentRepository.ts
-
4frontend/services/application/example/exampleData.ts
@ -0,0 +1,18 @@ |
|||||
|
import ApiService from '@/services/api.service' |
||||
|
import { Assignment } from '@/domain/models/example/example' |
||||
|
|
||||
|
export class APIAssignmentRepository { |
||||
|
constructor(private readonly request = ApiService) {} |
||||
|
|
||||
|
async assign(projectId: string, exampleId: number, userId: number): Promise<Assignment> { |
||||
|
const url = `/projects/${projectId}/assignments` |
||||
|
const payload = { example: exampleId, assignee: userId } |
||||
|
const response = await this.request.post(url, payload) |
||||
|
return response.data |
||||
|
} |
||||
|
|
||||
|
async unassign(projectId: string, assignmentId: string): Promise<void> { |
||||
|
const url = `/projects/${projectId}/assignments/${assignmentId}` |
||||
|
await this.request.delete(url) |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save