chore: update http method profile update endpoint
This commit is contained in:
parent
777e71dd4b
commit
d7060c8248
|
|
@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
|
||||||
import { userService } from "@/src/services/profile.service";
|
import { userService } from "@/src/services/profile.service";
|
||||||
import { withAuth } from "@/lib/withAuth";
|
import { withAuth } from "@/lib/withAuth";
|
||||||
|
|
||||||
export const POST = withAuth(async (req, _context, session) => {
|
export const PATCH = withAuth(async (req, _context, session) => {
|
||||||
try {
|
try {
|
||||||
const email = session.user?.email as string;
|
const email = session.user?.email as string;
|
||||||
const body = await req.json();
|
const body = await req.json();
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { ProfileFormData } from "../types";
|
||||||
|
|
||||||
export const updateProfileService = async (formData: ProfileFormData) => {
|
export const updateProfileService = async (formData: ProfileFormData) => {
|
||||||
const response = await fetch("/api/profile", {
|
const response = await fetch("/api/profile", {
|
||||||
method: "POST",
|
method: "PATCH",
|
||||||
body: JSON.stringify(formData),
|
body: JSON.stringify(formData),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue