fix form delete

This commit is contained in:
Michael Schramm 2022-02-28 22:48:39 +01:00
parent 5b717a2963
commit 2d3589e13a
2 changed files with 8 additions and 9 deletions

View File

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- only update user fields in update mutation if they changed
- form delete
### Security

View File

@ -14,15 +14,13 @@ export class FormDeleteService {
) {
}
async delete(id: string): Promise<void> {
await this.submissionRepository.createQueryBuilder('s')
.delete()
.where('s.form = :form', { form: id })
.execute()
async delete(id: number): Promise<void> {
await this.submissionRepository.delete({
form: new FormEntity({ id }),
})
await this.formRepository.createQueryBuilder('f')
.delete()
.where('f.id = :form', { form: id })
.execute()
await this.formRepository.delete({
id,
})
}
}