Skip to content

Commit

Permalink
Merge pull request #235 from TripInfoWeb/dev_mypage
Browse files Browse the repository at this point in the history
fix: 유저 이미지 주소 변경 수정
  • Loading branch information
ssssksss authored Aug 28, 2024
2 parents d7c0a02 + b454e16 commit 9a5be09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/app/api/mypage/user-image/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from "next/server";

export async function POST(request: NextRequest) {
export async function PUT(request: NextRequest) {
const access_cookie = request.cookies.get("access_token");
if (!access_cookie) {
const refresh_cookie = request.cookies.get("refresh_token");
Expand All @@ -15,8 +15,8 @@ export async function POST(request: NextRequest) {
const formData = await request.formData();
// formData.append("request", JSON.stringify({ userId: 11 }));
try {
const response = await fetch(`${process.env.BACKEND_URL}/api/user-image`, {
method: "POST",
const response = await fetch(`${process.env.BACKEND_URL}/api/users/profile`, {
method: "PUT",
headers: {
Cookie: `${access_cookie?.name}=${access_cookie?.value}`,
},
Expand Down
4 changes: 2 additions & 2 deletions src/utils/getCroppedImg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ export async function getCroppedImg(

try {
const formData = new FormData();
formData.append("userImage", file);
formData.append("userProfile", file);
await fetch("/api/mypage/user-image", {
method: "POST",
method: "PUT",
body: formData,
}).then(res => {
})
Expand Down

0 comments on commit 9a5be09

Please sign in to comment.