Changeset e007fcd for pages/api/poker
- Timestamp:
- 07/16/22 21:31:18 (2 years ago)
- Branches:
- main
- Children:
- e903234
- Parents:
- 55701f0
- Location:
- pages/api/poker
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pages/api/poker/gameStates.js
r55701f0 re007fcd 54 54 */ 55 55 56 export function createTable(playerId, playerName, tableName ) {56 export function createTable(playerId, playerName, tableName, username) { 57 57 const tableId = uuidv4(); 58 58 … … 75 75 id: playerId, 76 76 table: tableId, 77 username: username, 77 78 credits: 0, 78 79 status: '_1_just_entered', -
pages/api/poker/index.js
r55701f0 re007fcd 198 198 * @param tableId 199 199 * @param displayName 200 */ 201 if (req.query.action === 'join_a_table' && req.query?.session_id && req.query?.tableId && req.query?.displayName) { 200 * @param username 201 */ 202 if (req.query.action === 'join_a_table' && req.query?.session_id && req.query?.tableId && req.query?.displayName && req.query?.username) { 202 203 if (req.query.tableId.length > 0) { 203 204 const { success } = getTableAndPlayer(req.query.session_id); … … 210 211 id: req.query.session_id, 211 212 table: req.query.tableId, 213 username: req.query.username, 212 214 credits: 0, 213 215 status: '_1_just_entered', … … 241 243 * @param displayName 242 244 * @param tableName 243 */ 244 if (req.query.action === 'create_a_table' && req.query?.session_id && req.query?.displayName && req.query?.tableName) { 245 * @param username 246 */ 247 if (req.query.action === 'create_a_table' && req.query?.session_id && req.query?.displayName && req.query?.tableName && req.query?.username) { 245 248 const { success } = getTableAndPlayer(req.query.session_id); 246 249 247 250 if (!success) { 248 createTable(req.query.session_id, req.query.displayName, req.query.tableName );251 createTable(req.query.session_id, req.query.displayName, req.query.tableName, req.query.username); 249 252 } 250 253 … … 305 308 success: true, 306 309 displayName: postgreRes.data?.displayName, 310 username: postgreRes.data?.username, 307 311 session_id: postgreRes.data?.session_id, 308 312 credits: postgreRes.data?.credits,
Note:
See TracChangeset
for help on using the changeset viewer.