Skip to content

Commit ae96914

Browse files
committed
change return type to a deferred promise
1 parent ebae535 commit ae96914

File tree

1 file changed

+4
-0
lines changed
  • packages/runtime/src/enhancements/policy

1 file changed

+4
-0
lines changed

packages/runtime/src/enhancements/policy/handler.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,6 +1450,10 @@ export class PolicyProxyHandler<DbClient extends DbClientContract> implements Pr
14501450
operation: PolicyCrudKind,
14511451
fieldValues?: Record<string, number | string | boolean | null>
14521452
): Promise<boolean> {
1453+
return createDeferredPromise(() => this.doCheck(operation, fieldValues));
1454+
}
1455+
1456+
private async doCheck(operation: PolicyCrudKind, fieldValues?: Record<string, number | string | boolean | null>) {
14531457
let constraint = this.policyUtils.getCheckerConstraint(this.model, operation);
14541458
if (typeof constraint === 'boolean') {
14551459
return constraint;

0 commit comments

Comments
 (0)