Skip to content

Commit 4310e14

Browse files
authored
Merge pull request #31 from objectql/copilot/update-objectql-to-latest
2 parents 0729167 + b5df65f commit 4310e14

24 files changed

+6832
-10052
lines changed

examples/project-management/src/projects.hook.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { HookContext, ObjectQLContext } from '@objectql/types';
44
export const listenTo = 'projects';
55

66
export async function beforeFind(context: any) {
7+
// Safety check for context
8+
if (!context || !context.ctx) {
9+
// console.warn('[File Hook] Projects: Missing context or ctx');
10+
return;
11+
}
12+
713
if (!context.ctx.isSystem && context.ctx.userId) {
814
console.log(`[File Hook] Projects: Restricting access for ${context.ctx.userId}`);
915
context.utils.restrict(['owner', '=', context.ctx.userId]);

objectql.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export default {
66
}
77
},
88
presets: [
9-
'@objectos/preset-base'
9+
'@objectos/preset-base',
10+
'@example/project-management'
1011
]
1112
};

0 commit comments

Comments
 (0)