Skip to content

Commit

Permalink
Merge pull request #87 from nittre/feature_joinRoom
Browse files Browse the repository at this point in the history
[client] / entryGame 기능 수정
  • Loading branch information
nittre authored May 6, 2021
2 parents dd0482d + 228a3c1 commit 29933fc
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/WaitingPages/components/EntryGame.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,22 @@ import React from 'react';
import { useHistory } from 'react-router-dom';
import axios from 'axios';

function EntryGame() {
function EntryGame({ accessToken }) {
const history = useHistory();

const handleUrl = async () => {
console.log('test');
const result = await axios.post('http://localhost:4000/room/join', {});
history.push(`/room/${result.data}`);
const result = await axios.post(
'http://localhost:4000/room/join',
{},
{
headers: {
'Content-Type': 'application/json',
authorization: accessToken.accessToken,
},
Credentials: 'include',
}
);
history.push(`/room/${result.data.data}`);
};

return (
Expand Down

0 comments on commit 29933fc

Please sign in to comment.