fix: remove leftovers of childIds

This commit is contained in:
kolaente 2023-04-12 11:37:08 +02:00
parent a2cc9ddc88
commit bbaddb9406
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 0 additions and 13 deletions

View File

@ -18,7 +18,6 @@ export interface IProject extends IAbstract {
subscription: ISubscription
position: number
backgroundBlurHash: string
childProjectIds: number[]
parentProjectId: number
created: Date

View File

@ -22,7 +22,6 @@ export default class ProjectModel extends AbstractModel<IProject> implements IPr
subscription: ISubscription = null
position = 0
backgroundBlurHash = ''
childProjectIds = []
parentProjectId = 0
created: Date = null
@ -47,8 +46,6 @@ export default class ProjectModel extends AbstractModel<IProject> implements IPr
this.subscription = new SubscriptionModel(this.subscription)
}
this.childProjectIds = this.childProjects?.map(p => p.id) || []
this.created = new Date(this.created)
this.updated = new Date(this.updated)
}

View File

@ -110,15 +110,6 @@ export const useProjectStore = defineStore('project', () => {
const cancel = setModuleLoading(setIsLoading)
const projectService = new ProjectService()
const oldProject = projects.value[project.id]
if (oldProject && oldProject.parentProjectId !== project.parentProjectId && oldProject.parentProjectId > 0) {
const parentProject = projects.value[oldProject.parentProjectId]
if (parentProject) {
const childProjectIndex = parentProject.childProjectIds.findIndex(pId => pId === project.id)
parentProject.childProjectIds.splice(childProjectIndex, 1)
}
}
try {
await projectService.update(project)
setProject(project)