Browse Source
Merge pull request #2149 from doccano/enhancement/frontend-tag
Remove unused tag dto
pull/2152/head
Hiroki Nakayama
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
0 additions and
27 deletions
-
frontend/services/application/tag/tagApplicationService.ts
-
frontend/services/application/tag/tagData.ts
|
|
@ -1,22 +1,8 @@ |
|
|
|
import { TagDTO } from './tagData' |
|
|
|
import { TagRepository } from '~/domain/models/tag/tagRepository' |
|
|
|
|
|
|
|
export class TagApplicationService { |
|
|
|
constructor(private readonly repository: TagRepository) {} |
|
|
|
|
|
|
|
public async list(id: string): Promise<TagDTO[]> { |
|
|
|
const items = await this.repository.list(id) |
|
|
|
return items.map((item) => new TagDTO(item)) |
|
|
|
} |
|
|
|
|
|
|
|
public async create(projectId: string, text: string): Promise<void> { |
|
|
|
await this.repository.create(projectId, text) |
|
|
|
} |
|
|
|
|
|
|
|
public async delete(projectId: string, id: number): Promise<void> { |
|
|
|
return await this.repository.delete(projectId, id) |
|
|
|
} |
|
|
|
|
|
|
|
public async bulkUpdate(projectId: string | number, tags: string[]): Promise<void> { |
|
|
|
const currentTags = await this.repository.list(projectId) |
|
|
|
const currentTagNames = currentTags.map((tag) => tag.text) |
|
|
|
|
|
@ -1,13 +0,0 @@ |
|
|
|
import { TagItem } from '~/domain/models/tag/tag' |
|
|
|
|
|
|
|
export class TagDTO { |
|
|
|
id: number |
|
|
|
text: string |
|
|
|
project: string | number |
|
|
|
|
|
|
|
constructor(item: TagItem) { |
|
|
|
this.id = item.id |
|
|
|
this.text = item.text |
|
|
|
this.project = item.project |
|
|
|
} |
|
|
|
} |