Skip to content

Commit a161b3d

Browse files
authored
fix(platform): update gamefacts db when toggling (#112)
1 parent 226a6cb commit a161b3d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/platform/src/services/PlayService.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,11 @@ export async function toggleSwitch(args, ctx: Context) {
828828
return null // Or false, depending on expected return type
829829
}
830830

831+
await ctx.prisma.game.update({
832+
where: { id: args.gameId },
833+
data: { facts: { ...(currentGame.facts as any), toggle: args.toggle } },
834+
})
835+
831836
const eventToPublish: PlatformEvent<BaseGlobalNotificationType> = {
832837
type: BaseGlobalNotificationType.SWITCH_TOGGLED,
833838
facts: {

0 commit comments

Comments
 (0)