Skip to content

Commit

Permalink
Support entities with key property
Browse files Browse the repository at this point in the history
  • Loading branch information
remko committed Aug 4, 2023
1 parent 1be9d5e commit ccd3ebc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions bin/initialize-dev-db.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,27 @@ await call("commit", {
],
});

await call("commit", {
mode: "NON_TRANSACTIONAL",
mutations: [
{
insert: {
key: {
partitionId: {
projectId: projectID,
},
path: [{ kind: "KindWithKeyProperty", name: "Entity" }],
},
properties: {
key: {
integerValue: 14,
},
},
},
},
],
});

await call("commit", {
mode: "NON_TRANSACTIONAL",
mutations: [
Expand Down
2 changes: 1 addition & 1 deletion src/EntitiesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function EntitiesTable({
{p}
</Header>
),
id: p,
id: `property:${p}`,
accessor: ({ properties }: Entity) => (properties ?? {})[p],
Cell: ({ value }: { value?: PropertyValue }) => {
return value == null ? (
Expand Down

0 comments on commit ccd3ebc

Please sign in to comment.