Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export default class FunctionInvocationValidator implements AstValidator<Express
const versionArg = expr.args[0]?.value;
if (versionArg) {
const version = getLiteral<number>(versionArg);
if (version !== 4 && version !== 7) {
if (version !== undefined && version !== 4 && version !== 7) {
accept('error', 'first argument must be 4 or 7', {
node: expr.args[0]!,
});
Expand All @@ -212,7 +212,7 @@ export default class FunctionInvocationValidator implements AstValidator<Express
const versionArg = expr.args[0]?.value;
if (versionArg) {
const version = getLiteral<number>(versionArg);
if (version !== 1 && version !== 2) {
if (version !== undefined && version !== 1 && version !== 2) {
accept('error', 'first argument must be 1 or 2', {
node: expr.args[0]!,
});
Expand Down
2 changes: 2 additions & 0 deletions samples/sveltekit/src/routes/api/model/[...path]/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { schema } from "../../../../zenstack/schema";

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

Expand Down