Skip to content

Commit d5194e5

Browse files
committed
fixed and pushed, Final
1 parent b8dd15d commit d5194e5

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

apps/X/app/api/user/route.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,14 @@ interface EditUserInfoProp {
4242
dob: string;
4343
}
4444

45-
export const POST = async (req: NextRequest, user: EditUserInfoProp) => {
45+
export const POST = async (req: NextRequest) => {
4646
console.log("Hitting here");
4747
try {
4848
const session = await getServerSession(authOptions);
4949
if (!session) {
5050
return NextResponse.json({ message: "Unauthorized" }, { status: 401 });
5151
}
52-
const body = await req.json();
53-
console.log("Request Body:", body);
52+
const user: EditUserInfoProp = await req.json();
5453
const userID = session?.user?.id;
5554

5655
const updatedUser = await prisma.user.update({
@@ -64,7 +63,6 @@ export const POST = async (req: NextRequest, user: EditUserInfoProp) => {
6463
where: { id: userID },
6564
});
6665

67-
console.log(updatedUser, "<<<<<<<<<<<<<<<<<<<<<<<");
6866
return NextResponse.json(
6967
{ message: "Profile updated successfully", data: updatedUser },
7068
{ status: 200 }

apps/X/src/components/ui/Profile/EditProfileComp.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use client";
12
import axios from "axios";
23
import { Button } from "../button";
34
import { useState } from "react";
@@ -30,7 +31,7 @@ export const EditProfileComp = () => {
3031
e.preventDefault();
3132
console.log("submiting", formInput);
3233
try {
33-
const response = await axios.post("/api/user", formInput);
34+
const response = await axios.post("/api/user", formInput);
3435
} catch (error) {
3536
console.error("Error updating Profile", error);
3637
}

0 commit comments

Comments
 (0)