fix: label instead of id

This commit is contained in:
Yassine Sallemi 2025-02-17 16:07:42 +01:00
parent a1dd6f5ee5
commit 85d50f6fac

View File

@ -65,8 +65,9 @@ export class CategoryRepository extends BaseRepository<
category: id,
});
if (associatedBlocks) {
const category = await this.findOne({ _id: id });
throw new ForbiddenException(
`Category ${id} has blocks associated with it`,
`Category ${category?.label || id} has blocks associated with it`,
);
}
}