Skip to content

Commit

Permalink
[client] / entryGame 기능 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
nittre committed May 6, 2021
1 parent 147052a commit 228a3c1
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 228a3c1

Please sign in to comment.