diff --git a/genotype_api/database/crud/delete.py b/genotype_api/database/crud/delete.py index 57557c9..e48752c 100644 --- a/genotype_api/database/crud/delete.py +++ b/genotype_api/database/crud/delete.py @@ -11,19 +11,19 @@ class DeleteHandler(BaseHandler): async def delete_analysis(self, analysis: Analysis) -> None: - self.session.delete(analysis) + await self.session.delete(analysis) await self.session.commit() async def delete_plate(self, plate: Plate) -> None: - self.session.delete(plate) + await self.session.delete(plate) await self.session.commit() async def delete_sample(self, sample: Sample) -> None: - self.session.delete(sample) + await self.session.delete(sample) await self.session.commit() async def delete_user(self, user: User) -> None: - self.session.delete(user) + await self.session.delete(user) await self.session.commit() async def delete_snps(self) -> int: @@ -31,6 +31,6 @@ async def delete_snps(self) -> int: snps: list[SNP] = await self.fetch_all_rows(query) count: int = len(snps) for snp in snps: - self.session.delete(snp) + await self.session.delete(snp) await self.session.commit() return count