|
@ -3,7 +3,7 @@ import { Project } from '~/domain/models/project/project' |
|
|
import { TagItem } from '~/domain/models/tag/tag' |
|
|
import { TagItem } from '~/domain/models/tag/tag' |
|
|
import { APIProjectRepository, SearchQuery } from '~/repositories/project/apiProjectRepository' |
|
|
import { APIProjectRepository, SearchQuery } from '~/repositories/project/apiProjectRepository' |
|
|
|
|
|
|
|
|
type Options = { |
|
|
|
|
|
|
|
|
type ProjectFields = { |
|
|
name: string |
|
|
name: string |
|
|
description: string |
|
|
description: string |
|
|
guideline: string |
|
|
guideline: string |
|
@ -53,7 +53,7 @@ export class ProjectApplicationService { |
|
|
useRelation, |
|
|
useRelation, |
|
|
tags, |
|
|
tags, |
|
|
guideline = '' |
|
|
guideline = '' |
|
|
}: Options): Promise<Project> { |
|
|
|
|
|
|
|
|
}: ProjectFields): Promise<Project> { |
|
|
const project = Project.create( |
|
|
const project = Project.create( |
|
|
0, |
|
|
0, |
|
|
name, |
|
|
name, |
|
@ -88,7 +88,7 @@ export class ProjectApplicationService { |
|
|
enableGraphemeMode, |
|
|
enableGraphemeMode, |
|
|
useRelation, |
|
|
useRelation, |
|
|
guideline = '' |
|
|
guideline = '' |
|
|
}: Omit<Options, 'tags'> |
|
|
|
|
|
|
|
|
}: Omit<ProjectFields, 'tags'> |
|
|
): Promise<void> { |
|
|
): Promise<void> { |
|
|
const project = Project.create( |
|
|
const project = Project.create( |
|
|
projectId, |
|
|
projectId, |
|
@ -106,7 +106,6 @@ export class ProjectApplicationService { |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
// item.tags = [] // TODO: somewhat hacky
|
|
|
|
|
|
await this.repository.update(project) |
|
|
await this.repository.update(project) |
|
|
} catch (e: any) { |
|
|
} catch (e: any) { |
|
|
throw new Error(e.response.data.detail) |
|
|
throw new Error(e.response.data.detail) |
|
|