Ignore:
Timestamp:
08/09/22 16:09:32 (2 years ago)
Author:
Danilo <danilo.najkov@…>
Branches:
master
Children:
a569b7c
Parents:
899b19d
Message:

full auth flow

Location:
frontend/src/Dashboard
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • frontend/src/Dashboard/Menu.js

    r899b19d ra26f6a1  
    2525    const addMenu = (data) => {
    2626        setLoadingSave(true);
    27         axios.post(env.api + 'Menu/',{...data,price: parseInt(data.price)}, { headers: {Authorization: sessionStorage.getItem('Auth')}
     27        axios.post(env.api + 'Menu/',{...data,price: parseInt(data.price)}, { headers: {Authorization: localStorage.getItem('Auth')}
    2828        }).then(res => {
    2929            notification['success']({
     
    4242
    4343    const deleteMenu = (id) => {
    44         axios.delete(env.api + 'Menu/'+id, {headers: {Authorization: sessionStorage.getItem('Auth')}
     44        axios.delete(env.api + 'Menu/'+id, {headers: {Authorization: localStorage.getItem('Auth')}
    4545        }).then(res => {
    4646            notification['success']({
  • frontend/src/Dashboard/Reservations.js

    r899b19d ra26f6a1  
    2626                    from: date[0].format('YYYY-MM-DDThh:mm:ss') + 'Z',
    2727                    to: date[1].format('YYYY-MM-DDThh:mm:ss') + 'Z'
    28                 }, headers: {Authorization: sessionStorage.getItem('Auth')}
     28                }, headers: {Authorization: localStorage.getItem('Auth')}
    2929            }).then(res => {
    3030                axios.get(env.api + 'Reservations/new', {
    31                      headers: {Authorization: sessionStorage.getItem('Auth')}
     31                     headers: {Authorization: localStorage.getItem('Auth')}
    3232                }).then(newres=>{
    3333                    setNewReservations(newres.data);
     
    5454            params: {
    5555                status: newStatus
    56             }, headers: {Authorization: sessionStorage.getItem('Auth')}
     56            }, headers: {Authorization: localStorage.getItem('Auth')}
    5757        }).then(res => {
    5858            getReservations()
     
    6868            params: {
    6969                tableId: ev.target.value == '' ? 0 : ev.target.value
    70             }, headers: {Authorization: sessionStorage.getItem('Auth')}
     70            }, headers: {Authorization: localStorage.getItem('Auth')}
    7171        }).then(res => {
    7272            console.log("success");
  • frontend/src/Dashboard/Restaurant.js

    r899b19d ra26f6a1  
    3737    const submitEdit = (form) => {
    3838        setLoadingSave(true);
    39         axios.put(env.api + 'Restaurants/',{...form}, { headers: {Authorization: sessionStorage.getItem('Auth')}
     39        axios.put(env.api + 'Restaurants/',{...form}, { headers: {Authorization: localStorage.getItem('Auth')}
    4040        }).then(res => {
    4141            notification['success']({
  • frontend/src/Dashboard/Review.js

    r899b19d ra26f6a1  
    11import React, {useEffect, useState} from 'react'
    2 import {Button, Card, Input, List, Rate, Spin, Tooltip} from "antd";
     2import {Button, Card, Input, List, notification, Rate, Spin, Tooltip} from "antd";
    33import axios from "axios";
    44import env from "../env";
     
    1212        setLoading(true);
    1313        getRestaurant()
     14        console.log(props.user)
    1415    },[])
    1516    useEffect(()=> {
     
    3637                {props.front ?
    3738                    (props.user?
    38                         <Button style={{float:'right'}} type={'primary'} onClick={()=>props.setVisible(true)}>Внеси оценка</Button>
     39                        <Button style={{float:'right'}} type={'primary'} onClick={()=>props.user.isConfirmed ? props.setVisible(true) : notification['error']({message: <p>Мора да го потврдите вашиот мејл за да оставите оценка. <a href={'/confirm-email'}>Потврдете го тука</a></p>})}>Внеси оценка</Button>
    3940                        : <Tooltip title={'Мора да се најавите за да оставите оценка'}><Button style={{float:'right'}} disabled type={'primary'} onClick={()=>props.setVisible(true)}>Внеси оценка</Button></Tooltip>)
    4041                    : ''
Note: See TracChangeset for help on using the changeset viewer.