Skip to content

Commit fd5f66d

Browse files
committed
fix test generate
1 parent 8fc0da5 commit fd5f66d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/runtime/test/schemas/petstore/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export const schema = {
9292
},
9393
attributes: [
9494
{ name: "@@allow", args: [{ name: "operation", value: ExpressionUtils.literal("read") }, { name: "condition", value: ExpressionUtils.binary(ExpressionUtils.binary(ExpressionUtils.field("orderId"), "==", ExpressionUtils._null()), "||", ExpressionUtils.binary(ExpressionUtils.member(ExpressionUtils.field("order"), ["user"]), "==", ExpressionUtils.call("auth"))) }] },
95-
{ name: "@@allow", args: [{ name: "operation", value: ExpressionUtils.literal("update") }, { name: "condition", value: ExpressionUtils.binary(ExpressionUtils.binary(ExpressionUtils.binary(ExpressionUtils.member(ExpressionUtils.call("before"), ["name"]), "==", ExpressionUtils.field("name")), "&&", ExpressionUtils.binary(ExpressionUtils.member(ExpressionUtils.call("before"), ["category"]), "==", ExpressionUtils.field("category"))), "&&", ExpressionUtils.binary(ExpressionUtils.field("orderId"), "==", ExpressionUtils._null())) }] }
95+
{ name: "@@allow", args: [{ name: "operation", value: ExpressionUtils.literal("post-update") }, { name: "condition", value: ExpressionUtils.binary(ExpressionUtils.binary(ExpressionUtils.binary(ExpressionUtils.member(ExpressionUtils.call("before"), ["name"]), "==", ExpressionUtils.field("name")), "&&", ExpressionUtils.binary(ExpressionUtils.member(ExpressionUtils.call("before"), ["category"]), "==", ExpressionUtils.field("category"))), "&&", ExpressionUtils.binary(ExpressionUtils.member(ExpressionUtils.call("before"), ["orderId"]), "==", ExpressionUtils._null())) }] }
9696
],
9797
idFields: ["id"],
9898
uniqueFields: {

packages/runtime/test/schemas/petstore/schema.zmodel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ model Pet {
3636
@@allow('read', orderId == null || order.user == auth())
3737

3838
// only allow update to 'orderId' field if it's not set yet (unsold)
39-
@@allow('update', before().name == name && before().category == category && orderId == null)
39+
@@allow('post-update', before().name == name && before().category == category && before().orderId == null)
4040
}
4141

4242
model Order {

0 commit comments

Comments
 (0)