Skip to content

Commit b78bbe1

Browse files
committed
provide relationId from local relation when publishing
1 parent f313377 commit b78bbe1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/hypergraph-react/src/internal/use-generate-create-ops.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ export function useGenerateCreateOps<const S extends Entity.AnyNoContext>(type:
3333
}
3434

3535
for (const [key, relationId] of Object.entries(mappingEntry.relations || {})) {
36-
const toIds: { to: Id.Id }[] = [];
36+
const toIds: { to: Id.Id; relationId: Id.Id }[] = [];
3737
for (const entity of properties[key]) {
38-
toIds.push({ to: Id.Id(entity.id) });
38+
toIds.push({ to: Id.Id(entity.id), relationId: Id.Id(entity._relation.id) });
3939
}
4040
grcProperties[relationId] = toIds;
4141
}

0 commit comments

Comments
 (0)