Skip to content

Commit b3e4a0f

Browse files
committed
Fix scoping on create()
`e.alias` pushes the update expression to the outer with block. Necessary because `update` can't be scoped within a `select` (like I previously thought).
1 parent 62e1c6e commit b3e4a0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/user/unavailability/unavailability.edgedb.repository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class UnavailabilityEdgeDBRepository
3131
}));
3232
const query = e.select(inserted, (u) => ({
3333
...this.hydrate(u),
34-
updatedUser, // Attach to query, so it is executed.
34+
updatedUser: e.alias(updatedUser), // Attach to query, so it is executed.
3535
}));
3636
return await this.db.run(query);
3737
}

0 commit comments

Comments
 (0)