fix: remove leftovers of childIds
This commit is contained in:
parent
a2cc9ddc88
commit
bbaddb9406
@ -18,7 +18,6 @@ export interface IProject extends IAbstract {
|
||||
subscription: ISubscription
|
||||
position: number
|
||||
backgroundBlurHash: string
|
||||
childProjectIds: number[]
|
||||
parentProjectId: number
|
||||
|
||||
created: Date
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user