-
-
- {/*
+
+
+
+
+
+ {/*
*/}
- {/*
-
-
-
-
- Name |
- Price |
- Status |
- Actions |
-
-
-
- {products.map(
- ({ title, _id, price, status }) =>
- title && (
-
- {title} |
- {price} |
-
-
- {status ? "Live" : "Suspended"}
-
- |
-
-
+
+
+
+
+
+ Name |
+ Price |
+ Status |
+ Actions |
+
+
+
+ {products.map(
+ ({ title, _id, price, status }) =>
+ title && (
+
+ {title} |
+ {price} |
+
+
+ {status ? "Live" : "Suspended"}
+
+ |
+
+
-
+
-
-
-
- |
-
- )
- )}
-
-
-
+
+
+
+ |
+
+ )
+ )}
+
+
+
- {/*
-
+ {/* */}
- {/* */}
+
+
- );
+ {/* */}
+
+
+ );
}
export default Products;
diff --git a/src/views/Profile/Profile.js b/src/views/Profile/Profile.js
index 4181527..073d2ff 100644
--- a/src/views/Profile/Profile.js
+++ b/src/views/Profile/Profile.js
@@ -20,7 +20,7 @@ const Profile = () => {
const [user, setUser] = useState({});
const { token } = isAutheticated();
const history = useHistory()
- console.log(token);
+ // console.log(token);
useEffect(async () => {
let res = await axios.get('/owner', {
headers: {
@@ -28,13 +28,15 @@ const Profile = () => {
}
})
if (res) {
+ // console.log(res.data.user._id)
+ localStorage.setItem('ownerId', res.data.user._id)
setUser(res.data.user)
}
- console.log(res);
+ // console.log(res);
}, [])
- console.log(user);
+ // console.log(user);
return (
@@ -42,10 +44,11 @@ const Profile = () => {
Profile
- history.push('/edit')}>Edit Profile
+ history.push('/edit')}>Edit Profile
-
+
Cafe Name
diff --git a/src/views/pages/login/Login.js b/src/views/pages/login/Login.js
index f6db129..ce7fc8e 100644
--- a/src/views/pages/login/Login.js
+++ b/src/views/pages/login/Login.js
@@ -33,10 +33,13 @@ const Login = () => {
const Login = async () => {
const res = await axios.post("/owner/signin", auth);
if (res.data.status == "ok") {
+ localStorage.setItem("authToken", res.data.token)
+ console.log(res.data)
localStorage.setItem("auth", JSON.stringify({
user: res.data.user,
token: res.data.token,
+
}));
history.push('/dashboard')