refactor: admin interface: number of quotes instead of quotes
This commit is contained in:
parent
e2ad380c6c
commit
4f760bb5ed
@ -9,7 +9,7 @@
|
||||
</tr>
|
||||
<tr class="admin-tile-players__player" @click="editPlayer(player.id)" v-for="player in players" :key="player.id">
|
||||
<td>{{ player.name }}</td>
|
||||
<td>{{ player.quotes.length }}</td>
|
||||
<td>{{ player.numQuotes }}</td>
|
||||
<td>{{ player.score }}</td>
|
||||
<td>{{ player.isPlaying ? (player.isIdle ? 'idle' : 'active') : '-'}}</td>
|
||||
</tr>
|
||||
|
@ -6,7 +6,8 @@ func (gm *Game) GetGameInfo() *GameInfoJson {
|
||||
gameInfo := gm.initGameInfoJson()
|
||||
|
||||
for i, _ := range gameInfo.Players {
|
||||
gameInfo.Players[i].Quotes = gm.getQuotesInfoByUserId(gameInfo.Players[i].Id)
|
||||
quotes := gm.getQuotesInfoByUserId(gameInfo.Players[i].Id)
|
||||
gameInfo.Players[i].NumberOfQuotes = len(quotes)
|
||||
}
|
||||
return gameInfo
|
||||
}
|
||||
|
@ -81,12 +81,12 @@ type QuotesInfo struct {
|
||||
}
|
||||
|
||||
type PlayerInfoJson struct {
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Score int `json:"score"`
|
||||
IsPlaying bool `json:"isPlaying"`
|
||||
IsIdle bool `json:"isIdle"`
|
||||
Quotes []Quote `json:"quotes"`
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Score int `json:"score"`
|
||||
IsPlaying bool `json:"isPlaying"`
|
||||
IsIdle bool `json:"isIdle"`
|
||||
NumberOfQuotes int `json:"numQuotes"`
|
||||
}
|
||||
|
||||
type GameInfoJson struct {
|
||||
|
Loading…
Reference in New Issue
Block a user