summaryrefslogtreecommitdiff
path: root/frontend/src/schemas
diff options
context:
space:
mode:
authorVictor Chabbert <chabbertvi@eisti.eu>2017-01-22 14:48:24 +0100
committerVictor Chabbert <chabbertvi@eisti.eu>2017-01-22 14:48:37 +0100
commit7b6230dc1c2613b965f4ff21836432076248dfde (patch)
tree83d8732ce9f87104faf4c6789c79d1d74dc6b575 /frontend/src/schemas
parentRefactor user reducer to player reducer (diff)
downloadseven-wonders-7b6230dc1c2613b965f4ff21836432076248dfde.tar.gz
seven-wonders-7b6230dc1c2613b965f4ff21836432076248dfde.tar.bz2
seven-wonders-7b6230dc1c2613b965f4ff21836432076248dfde.zip
Normalize games data from server and display games list
Diffstat (limited to 'frontend/src/schemas')
-rw-r--r--frontend/src/schemas/games.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/frontend/src/schemas/games.js b/frontend/src/schemas/games.js
new file mode 100644
index 00000000..180c9e69
--- /dev/null
+++ b/frontend/src/schemas/games.js
@@ -0,0 +1,11 @@
+import { schema } from 'normalizr'
+
+const player = new schema.Entity('players', {}, {
+ idAttribute: 'username'
+})
+
+const game = new schema.Entity('games', {
+ players: [ player ]
+})
+
+export default [ game ]
bgstack15