From 80e00a5862a0810f1c4a741cb124ff6be2964806 Mon Sep 17 00:00:00 2001 From: Fabio Epifani Date: Wed, 7 Feb 2024 22:47:45 +0000 Subject: [PATCH] Fix JSON codec --- modules/domain/src/main/scala/bastoni/domain/model/Seat.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/domain/src/main/scala/bastoni/domain/model/Seat.scala b/modules/domain/src/main/scala/bastoni/domain/model/Seat.scala index 217f3f8..b124cdf 100644 --- a/modules/domain/src/main/scala/bastoni/domain/model/Seat.scala +++ b/modules/domain/src/main/scala/bastoni/domain/model/Seat.scala @@ -21,7 +21,7 @@ object Seat: given [C <: CardView: Decoder]: Decoder[Seat[C]] = Decoder.instance { cursor => for emptySeat <- deriveDecoder[EmptySeat[C]].tryDecode(cursor) - player <- cursor.downField("player").as[Option[PlayerState]] + player <- cursor.downField("occupant").as[Option[PlayerState]] yield player.fold(emptySeat)(emptySeat.occupiedBy) }