fix: bug in put assignment waarbij groepen niet werden aangepast gefixt
This commit is contained in:
parent
b7486b4d1b
commit
3d8c8302d6
3 changed files with 40 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
import { EntityRepository, FilterQuery } from '@mikro-orm/core';
|
||||
import { EntityAlreadyExistsException } from '../exceptions/entity-already-exists-exception.js';
|
||||
import { getLogger } from '../logging/initalize.js';
|
||||
|
||||
export abstract class DwengoEntityRepository<T extends object> extends EntityRepository<T> {
|
||||
public async save(entity: T, options?: { preventOverwrite?: boolean }): Promise<void> {
|
||||
|
@ -16,4 +17,13 @@ export abstract class DwengoEntityRepository<T extends object> extends EntityRep
|
|||
await em.flush();
|
||||
}
|
||||
}
|
||||
public async deleteAllWhere(query: FilterQuery<T>): Promise<void> {
|
||||
const toDelete = await this.find(query);
|
||||
const em = this.getEntityManager();
|
||||
|
||||
if (toDelete) {
|
||||
em.remove(toDelete);
|
||||
await em.flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue