project creation request form working
This commit is contained in:
parent
6c84f723f7
commit
c750001a2c
14 changed files with 194 additions and 89 deletions
|
|
@ -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,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue