Merge pull request #1297 from spotify/freben/delete-location

fix(catalog-backend): make location delete work again
This commit is contained in:
Fredrik Adelöw
2020-06-15 13:33:35 +02:00
committed by GitHub
@@ -390,6 +390,10 @@ export class CommonDatabase implements Database {
async removeLocation(txOpaque: unknown, id: string): Promise<void> {
const tx = txOpaque as Knex.Transaction<any, any>;
await tx<DbEntitiesRow>('entities')
.where({ location_id: id })
.update({ location_id: null });
const result = await tx<DbLocationsRow>('locations').where({ id }).del();
if (!result) {