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 ### Fixed
- only update user fields in update mutation if they changed - only update user fields in update mutation if they changed
- form delete
### Security ### Security

View File

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