init simple create

This commit is contained in:
Patryk
2025-04-29 19:42:06 +02:00
parent ba07581f31
commit 53be0b2f50

View File

@@ -20,16 +20,16 @@ export async function getNoticeById(noticeId) {
}
export async function createNotice(notice) {
console.log("Notice created", notice);
// const response = await fetch(`${API_URL}add`, {
// method: "POST",
// headers: {
// "Content-Type": "application/json",
// },
// body: JSON.stringify(notice),
// });
// console.log("Response", response);
// if (!response.ok) {
// throw new Error("Error");
// }
// console.log("Notice created", notice);
const response = await fetch(`${API_URL}add`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(notice),
});
console.log("Response", response);
if (!response.ok) {
throw new Error("Error");
}
}