project creation request form working

This commit is contained in:
isUnknown 2025-01-23 15:31:15 +01:00
parent 6c84f723f7
commit c750001a2c
14 changed files with 194 additions and 89 deletions

View file

@ -75,6 +75,28 @@ export const useApiStore = defineStore("api", () => {
}
}
async function requestProjectCreation(data) {
const headers = {
method: "POST",
body: JSON.stringify(data),
};
try {
const response = await fetch("/request-project-creation.json", headers);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
console.log(data);
} catch (error) {
console.error(
"Une erreur s'est produite lors de l'ajout du commentaire :",
error
);
throw error;
}
}
async function updateComment(comment) {
const headers = {
method: "POST",
@ -144,12 +166,6 @@ export const useApiStore = defineStore("api", () => {
}
}
/**
*
* @param {string} comment
* @param {string} projectId UUID or URI
* @returns status with message if error
*/
async function readNotification(notificationId, projectId) {
const headers = {
method: "POST",
@ -233,5 +249,6 @@ export const useApiStore = defineStore("api", () => {
readNotification,
readAllNotifications,
validateBrief,
requestProjectCreation,
};
});