import React, { useState, useEffect } from 'react';
import Menu from '../Components/Menu';
import axios from 'axios';
import { Link, Redirect } from 'react-router-dom';
import 'bootstrap/dist/css/bootstrap.css';
function ACheck(props) {
const [state, setState] = useState()
const [reserve, setReserve] = useState([]);
useEffect(() => {
getReserve();
}, [])
function getReserve() {
axios.get(`/users/admin/${props.match.params.id}`, {
headers: { authorization: localStorage.getItem('token') },
})
.then(res => {
if (res.status === 404) {
alert(res.data.error)
setState(true);
}
console.log(res.data);
setReserve(res.data);
})
.catch(err => {
alert(err.error)
});
}
if (state) return
대표자 | 날짜 | 시간 | 강의실 | 사용인원 | 승인여부 |
---|---|---|---|---|---|
{reserve.user.name} | {reserve.date} | {reserve.starttime}시~{(Number(reserve.starttime) + reserve.usetime)}시 | {reserve.room} | {reserve.num} |