Skip to content

Commit 796d9e7

Browse files
committed
things we presented in DW
1 parent 6af47d8 commit 796d9e7

File tree

15 files changed

+266
-238
lines changed

15 files changed

+266
-238
lines changed

backend/app/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,4 +482,4 @@ def index():
482482

483483
if __name__ == '__main__':
484484
scheduler.start()
485-
app.run(host='0.0.0.0', debug=True)
485+
app.run(host='0.0.0.0', debug=True)

frontend/app/(site)/page.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import Butt from "../components/button";
88
import Link from "next/link";
99
import { useRouter } from "next/navigation";
1010

11-
1211
// export const metadata: Metadata = {
1312
// title: "Brew & Brain",
1413
// description: "Brew * Brain",
@@ -85,12 +84,9 @@ export default function Home() {
8584
<section>
8685
<About />
8786
</section>
88-
<section>
89-
<Discounts />
90-
</section>
91-
<footer>
87+
{/* <footer>
9288
<Footer />
93-
</footer>
89+
</footer> */}
9490
</div>
9591
);
9692
}

frontend/app/account/page.tsx

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import TemporaryDrawer from "../components/side_bar";
1414
function page() {
1515
const [username, setUsername] = useState("");
1616
useEffect(() => {
17-
const accessToken = localStorage.getItem('user');
18-
setUsername(accessToken ? JSON.parse(accessToken).Username : "")
17+
const accessToken = localStorage.getItem("user");
18+
setUsername(accessToken ? JSON.parse(accessToken).Username : "");
1919
document.title = "Account";
2020
}, []);
2121

@@ -61,16 +61,6 @@ function page() {
6161
</Link>
6262
<Line></Line>
6363
</div>
64-
65-
<div className="text-sm mt-4">
66-
<Link href="#">
67-
<Dropdown
68-
title="Rewards"
69-
LeftArrow={<KeyboardArrowRightIcon style={{ fontSize: 23 }} />}
70-
/>
71-
</Link>
72-
<Line></Line>
73-
</div>
7464
</div>
7565

7666
<div className="mt-7">
@@ -97,21 +87,17 @@ function page() {
9787
</Link>
9888
<Line></Line>
9989
</div>
100-
101-
<div className="text-sm mt-4">
102-
<Link href="#">
103-
<Dropdown
104-
title="Notifications"
105-
LeftArrow={<KeyboardArrowRightIcon style={{ fontSize: 23 }} />}
106-
/>
107-
</Link>
108-
<Line></Line>
109-
</div>
11090
</div>
11191

11292
<div className="mt-20"></div>
11393

114-
<Butt title="Log Out" Bgcolor="#FFF1E4" width="325px" height="34px" onClick={handleLogout} />
94+
<Butt
95+
title="Log Out"
96+
Bgcolor="#FFF1E4"
97+
width="325px"
98+
height="34px"
99+
onClick={handleLogout}
100+
/>
115101
</div>
116102
);
117103
}

frontend/app/admin_accounts/[userId]/page.tsx

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use client';
1+
"use client";
22
import React, { useState, useEffect } from "react";
33
import Teste from "@/app/components/account";
44
import CloseIcon from "@mui/icons-material/Close";
@@ -7,18 +7,15 @@ import CircleIcon from "@mui/icons-material/Circle";
77
import TextInput from "@/app/components/text_input";
88
import Drop from "@/app/components/dropdown_button";
99
import Butt from "@/app/components/button";
10-
11-
10+
import Link from "next/link";
1211

1312
function Page() {
14-
1513
const handleBackButtonClick = () => {
16-
console.log("back button clicked")
17-
}
14+
console.log("back button clicked");
15+
};
1816

19-
20-
const userId = localStorage.getItem('user_id')
21-
console.log(userId)
17+
const userId = localStorage.getItem("user_id");
18+
console.log(userId);
2219

2320
const [formData, setFormData] = useState({
2421
userName: "",
@@ -33,10 +30,12 @@ function Page() {
3330

3431
const fetchUserData = async () => {
3532
try {
36-
const response = await fetch(`http://localhost:5000/api/get-user/${userId}`);
33+
const response = await fetch(
34+
`http://localhost:5000/api/get-user/${userId}`
35+
);
3736
if (response.ok) {
3837
const userData = await response.json();
39-
const datas = userData.user
38+
const datas = userData.user;
4039
console.log("User Data:", userData); // Log the received user data
4140
console.log("User Data1:", datas); // Log the received user data
4241
setFormData({
@@ -83,6 +82,7 @@ function Page() {
8382
if (response.ok) {
8483
const updatedUserData = await response.json();
8584
console.log("Profile updated successfully:", updatedUserData);
85+
alert("Customer's profile updated.");
8686
} else {
8787
console.error("Error updating profile:", await response.json());
8888
}
@@ -163,13 +163,15 @@ function Page() {
163163

164164
<div className="mt-16"></div>
165165

166-
<Butt
167-
title="Update Profile"
168-
Bgcolor="#FFF1E4"
169-
width="325px"
170-
height="34px"
171-
onClick={handleUpdateProfile}
172-
/>
166+
<Link href="/admin_accounts">
167+
<Butt
168+
title="Update Profile"
169+
Bgcolor="#FFF1E4"
170+
width="325px"
171+
height="34px"
172+
onClick={handleUpdateProfile}
173+
/>
174+
</Link>
173175
</div>
174176
);
175177
}

frontend/app/admin_accounts/page.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ function Page() {
8181
</div>
8282

8383
<div className="container flex items-center justify-center space-x-5 text-xs text-black font-bold mt-2">
84-
<Link href="/admin_dashboard">
85-
<p>Dashboard</p>
86-
</Link>
8784
<Link href="/admin_areamap">
8885
<p>Area Map</p>
8986
</Link>
@@ -95,7 +92,6 @@ function Page() {
9592
</div>
9693

9794
<div className="container flex items-center justify-center space-x-8 text-xs text-black font-bold mb-2">
98-
<p className="text-backcolor">_________</p>
9995
<p className="text-backcolor">________</p>
10096
<p className="text-backcolor">____________</p>
10197
<p className="text-amber-500">____________</p>

0 commit comments

Comments
 (0)