init simple create
This commit is contained in:
@@ -20,16 +20,16 @@ export async function getNoticeById(noticeId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function createNotice(notice) {
|
export async function createNotice(notice) {
|
||||||
console.log("Notice created", notice);
|
// console.log("Notice created", notice);
|
||||||
// const response = await fetch(`${API_URL}add`, {
|
const response = await fetch(`${API_URL}add`, {
|
||||||
// method: "POST",
|
method: "POST",
|
||||||
// headers: {
|
headers: {
|
||||||
// "Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
// },
|
},
|
||||||
// body: JSON.stringify(notice),
|
body: JSON.stringify(notice),
|
||||||
// });
|
});
|
||||||
// console.log("Response", response);
|
console.log("Response", response);
|
||||||
// if (!response.ok) {
|
if (!response.ok) {
|
||||||
// throw new Error("Error");
|
throw new Error("Error");
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user