Skip to content

Commit

Permalink
fix(authorization): missing relation size check in reindex
Browse files Browse the repository at this point in the history
  • Loading branch information
kkopanidis committed Jan 18, 2024
1 parent 5b57db6 commit 41e7d2d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions modules/authorization/src/controllers/index.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ export class IndexController {
{ resourceType: resource },
],
});
await QueueController.getInstance().addRelationIndexJob(
relations.map(r => ({
subject: r.subject,
relation: r.relation,
object: r.resource,
})),
);
if (relations.length > 0) {
await QueueController.getInstance().addRelationIndexJob(
relations.map(r => ({
subject: r.subject,
relation: r.relation,
object: r.resource,
})),
);
}
}

async createOrUpdateObject(subject: string, entity: string) {
Expand Down

0 comments on commit 41e7d2d

Please sign in to comment.