fix(project): do not remove project from navigation after removing background image

This commit is contained in:
kolaente 2024-05-07 17:13:22 +02:00
parent fa628edc0c
commit 31e502d711
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 7 additions and 3 deletions

View File

@ -52,12 +52,16 @@ export default class ProjectService extends AbstractService<IProject> {
return window.URL.createObjectURL(new Blob([response.data]))
}
async removeBackground(project: Pick<IProject, 'id'>) {
async removeBackground(project: IProject) {
const cancel = this.setLoading()
try {
const response = await this.http.delete(`/projects/${project.id}/background`, project)
return response.data
await this.http.delete(`/projects/${project.id}/background`)
return {
...project,
backgroundInformation: null,
backgroundBlurHash: '',
}
} finally {
cancel()
}