mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix(repository): ensure category update check before processing blocks
This commit is contained in:
parent
4692339bea
commit
e671f0ab24
@ -131,8 +131,9 @@ export class BlockRepository extends BaseRepository<
|
||||
criteria: TFilterQuery<Block>,
|
||||
updates: UpdateQuery<Document<Block, any, any>>,
|
||||
): Promise<void> {
|
||||
const categoryId: string = updates.$set.category;
|
||||
if (categoryId) {
|
||||
// Only proceed if category is being updated
|
||||
if (updates.$set?.category) {
|
||||
const categoryId: string = updates.$set.category;
|
||||
const movedBlocks = await this.find(criteria);
|
||||
|
||||
if (movedBlocks.length) {
|
||||
|
Loading…
Reference in New Issue
Block a user