Browse Source

Enable to feed option

pull/1310/head
Hironsan 4 years ago
parent
commit
399f34318d
3 changed files with 6 additions and 6 deletions
  1. 2
      frontend/domain/models/upload/parseRepository.ts
  2. 5
      frontend/repositories/upload/apiParseRepository.ts
  3. 5
      frontend/services/application/upload/parseApplicationService.ts

2
frontend/domain/models/upload/parseRepository.ts

@ -1,3 +1,3 @@
export interface ParseRepository {
analyze(projectId: string, format: string, uploadIds: number[]): Promise<string>
analyze(projectId: string, format: string, uploadIds: number[], option: object): Promise<string>
}

5
frontend/repositories/upload/apiParseRepository.ts

@ -6,11 +6,12 @@ export class APIParseRepository implements ParseRepository {
private readonly request = ApiService
) {}
async analyze(projectId: string, format: string, uploadIds: number[]): Promise<string> {
async analyze(projectId: string, format: string, uploadIds: number[], option: object): Promise<string> {
const url = `/projects/${projectId}/upload`
const data = {
format,
uploadIds
uploadIds,
...option
}
const response = await this.request.post(url, data)
return response.data.task_id

5
frontend/services/application/upload/parseApplicationService.ts

@ -5,9 +5,8 @@ export class ParseApplicationService {
private readonly repository: ParseRepository
) {}
public async analyze(projectId: string, format: string, uploadIds: number[]): Promise<string> {
const item = await this.repository.analyze(projectId, format, uploadIds)
public async analyze(projectId: string, format: string, uploadIds: number[], option: object): Promise<string> {
const item = await this.repository.analyze(projectId, format, uploadIds, option)
return item
}
}
Loading…
Cancel
Save