react와 nextjs 최신 동향
게시일: 2025-04-23 | 조회수: 178
dsadasd
-= asdasdasd
ㅁㄴㅇㅁㄴㅇ
* -ㅁㄴㅇㅁㄴㅇㅁㄴ
* ㄴㅁㅇㅁㄴㅇㅁㄴㅇ
* ㅇㄹㅎㄴㄹㄴㅇㄹ
* ㅇㄴㅁㅇㅁㄴㅇㅁㄴㅇ
* ㄴㅇㅁㄴㅇ
\`\`\`
ㅁㄴㅇ
ㅋㅌ
dasdas,dmasd
glkgfkdv
\`\`\` code
jaasdvavasvas
ㅁㄴㅇㅁㄴㅇㅁㄴㅇㅁㄴㅇ
ㅁㄴㅇㅁㄴㅇㅁㄴㅇ
ㅁㄴㅇㅁㄴㅇㅁ
```jsx
try {
const response = await fetch(`/api/posts/${postData.slug}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: postData.title,
slug: postData.slug,
content: postData.content,
excerpt: postData.excerpt,
featuredImage: postData.featuredImage,
published: postData.published,
tagIds: postData.tags?.map(tag => tag.id) ?? [],
})
});
if (!response.ok) {
const errorText = await response.text();
console.error('서버 오류 응답:', response.status, errorText);
let errorMessage = '포스트 업데이트에 실패했습니다.';
```
