Skip to content

Commit

Permalink
fixed booking not logged
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfdsilva committed May 20, 2021
1 parent d4a56e7 commit f26b97b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions web/src/components/Customer/Bookings/BookingFormNew/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ import api from '../../../../services/api';

export default function BookingFormNew(props) {
const [id, setID] = useState(localStorage.getItem('id'));
const [accessToken, setAccessToken] = useState(
localStorage.getItem('accessToken'),
);
const [dateValue, setDateValue] = useState(new Date());
const [availableSlots, setAvailableSlots] = useState([]);
const [selectedSlot, setSelectedSlot] = useState();
Expand All @@ -39,6 +42,8 @@ export default function BookingFormNew(props) {
const history = useHistory();

useEffect(() => {
if (!id || !accessToken) return history.push('/login');

async function loadHairdresser() {
try {
const response = await api.get(`/users/${hairdresserId}`);
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/Customer/Home/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default function HomePageBody() {
variant='h4'
className={classes.faceRecognitionTextContainer}
>
Discover our AR Hairstyler
Discover the new AR Hairstyler
<br></br>
<Typography variant='body1'>
Our Augmented Reality Hairstyler uses Machine Learning to read
Expand Down

0 comments on commit f26b97b

Please sign in to comment.