Fix event bug

This commit is contained in:
Joseph Ferano 2022-04-21 12:29:10 +07:00
parent 1471cc1ba8
commit a93ea189c0

View File

@ -58,7 +58,7 @@ let updateSlotPlayedFromPlayer (did : uint64) =
|> Sql.query """
WITH usr AS (SELECT id FROM "user" WHERE discord_id = @did)
UPDATE player_event SET updated_at = now() at time zone 'utc'
FROM usr WHERE usr.id = user_id;
FROM usr WHERE usr.id = user_id AND player_event.event_type = 'PlayingSlot';
"""
|> Sql.executeNonQueryAsync
|> Async.AwaitTask
@ -250,7 +250,7 @@ let addPlayerEvent (did : uint64) (playerEvent : PlayerEvent) =
"""
WITH usr AS (SELECT id FROM "user" WHERE discord_id = @did)
INSERT INTO player_event (event_type, cooldown, user_id)
SELECT 'Imprison', 1, usr.id FROM usr
SELECT 'PlayingSlot', 1, usr.id FROM usr
"""
| Imprison ->
[