diff --git a/src/app/api/profile/route.ts b/src/app/api/profile/route.ts index 83c776c..bb9070c 100644 --- a/src/app/api/profile/route.ts +++ b/src/app/api/profile/route.ts @@ -2,7 +2,7 @@ import { NextResponse } from "next/server"; import { userService } from "@/src/services/profile.service"; import { withAuth } from "@/lib/withAuth"; -export const POST = withAuth(async (req, _context, session) => { +export const PATCH = withAuth(async (req, _context, session) => { try { const email = session.user?.email as string; const body = await req.json(); diff --git a/src/services/profile.service.ts b/src/services/profile.service.ts index 354a54c..9a5c569 100644 --- a/src/services/profile.service.ts +++ b/src/services/profile.service.ts @@ -3,7 +3,7 @@ import { ProfileFormData } from "../types"; export const updateProfileService = async (formData: ProfileFormData) => { const response = await fetch("/api/profile", { - method: "POST", + method: "PATCH", body: JSON.stringify(formData), });