Skip to content
This repository was archived by the owner on Mar 1, 2026. It is now read-only.

Commit 97ec4af

Browse files
authored
fix: minor fixes addressing AI comments (#552)
1 parent 65388a5 commit 97ec4af

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

packages/language/src/validators/function-invocation-validator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export default class FunctionInvocationValidator implements AstValidator<Express
198198
const versionArg = expr.args[0]?.value;
199199
if (versionArg) {
200200
const version = getLiteral<number>(versionArg);
201-
if (version !== 4 && version !== 7) {
201+
if (version !== undefined && version !== 4 && version !== 7) {
202202
accept('error', 'first argument must be 4 or 7', {
203203
node: expr.args[0]!,
204204
});
@@ -212,7 +212,7 @@ export default class FunctionInvocationValidator implements AstValidator<Express
212212
const versionArg = expr.args[0]?.value;
213213
if (versionArg) {
214214
const version = getLiteral<number>(versionArg);
215-
if (version !== 1 && version !== 2) {
215+
if (version !== undefined && version !== 1 && version !== 2) {
216216
accept('error', 'first argument must be 1 or 2', {
217217
node: expr.args[0]!,
218218
});

samples/sveltekit/src/routes/api/model/[...path]/+server.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { schema } from "../../../../zenstack/schema";
55

66
const handler = SvelteKitRouteHandler({
77
apiHandler: new RPCApiHandler({ schema }),
8+
// fully open ZenStackClient is used here for demo purposes only, in a real application,
9+
// you should use one with access policies enabled
810
getClient: () => db,
911
});
1012

0 commit comments

Comments
 (0)