fix: fetch was not using rest requests

This commit is contained in:
2025-07-04 10:24:43 -04:00
parent a41d1ceaea
commit deed5a9f83
5 changed files with 30 additions and 4 deletions
+6 -1
View File
@@ -16,7 +16,12 @@ export function EditBlog() {
useEffect(() => {
if (!slug) return;
fetch(`${API_URL}/blogs/${slug}`)
fetch(`${API_URL}/blogs/${slug}`, {
method: "GET",
headers: {
"Content-Type": "application/json",
},
})
.then((res) => res.json())
.then((data: Blog) => {
setBlog(data);