Enha: remove marks

This commit is contained in:
Grail Finder
2025-07-05 10:16:17 +03:00
parent 413edae4b6
commit eef4b7941b
8 changed files with 51 additions and 20 deletions

View File

@ -75,10 +75,25 @@ func getFullInfoByCtx(ctx context.Context) (*models.FullInfo, error) {
}
return nil, err
}
// get card_marks
if room.IsRunning && room.MimeDone {
fillCardMarks(ctx, room)
}
resp.Room = room
return resp, nil
}
func fillCardMarks(ctx context.Context, room *models.Room) error {
for i, card := range room.Cards {
marks, err := repo.CardMarksByCardID(ctx, card.ID)
if err != nil {
return err
}
room.Cards[i].Marks = marks
}
return nil
}
func getPlayerByCtx(ctx context.Context) (*models.Player, error) {
username, ok := ctx.Value(models.CtxUsernameKey).(string)
if !ok {