fix: still having 403 bit fixed some bugs
Some checks failed
Format / formatting (push) Successful in 9s
Build / build (push) Successful in 42s
CI / build (push) Failing after 10s
Format / formatting (pull_request) Successful in 6s

This commit is contained in:
2025-04-29 20:19:24 +02:00
parent 4044a95dd1
commit eb302268ba
8 changed files with 217 additions and 148 deletions

View File

@ -40,6 +40,8 @@
<script setup lang="ts">
import { ref } from "vue";
import Project from "@/ApiClasses/Project";
import { requestProjectCreation } from "@/services/Apis/Entrepreneurs.ts";
const choix = ref<string | null>(null);
const nomProjet = ref("");
@ -53,8 +55,36 @@ const validerCreation = () => {
alert("Veuillez entrer un nom de projet.");
return;
}
alert(`Projet "${nomProjet.value}" créé avec succès !`);
// Obtenir la date actuelle au format YYYY-MM-DD
const today = new Date();
const yyyy = today.getFullYear();
const mm = String(today.getMonth() + 1).padStart(2, "0");
const dd = String(today.getDate()).padStart(2, "0");
const formattedDate = `${yyyy}-${mm}-${dd}`;
// Créer une instance de Project
const nouveauProjet = new Project({
projectName: nomProjet.value.trim(),
creationDate: formattedDate,
status: "PENDING",
});
// Appeler lAPI
requestProjectCreation(
nouveauProjet,
(response) => {
console.log("Projet créé :", response.data);
alert(`Projet "${nomProjet.value}" créé avec succès !`);
},
(error) => {
console.error("Erreur lors de la création du projet :", error);
alert("Une erreur est survenue lors de la création du projet.");
}
);
};
</script>
<style scoped>