fix: api integration

This commit is contained in:
Mohamed Maoulainine Maoulainine
2025-05-02 01:26:08 +02:00
parent 49e52e1826
commit c3ad092512
7 changed files with 374 additions and 130 deletions

View File

@ -12,24 +12,13 @@
/>
</div>
<div class="form-group">
<label for="creationDate">Date de création</label>
<input
id="creationDate"
v-model="project.creationDate"
type="text"
placeholder="JJ-MM-AAAA"
required
/>
</div>
<div class="form-group">
<label for="logo">Logo</label>
<input
id="logo"
v-model="project.logo"
type="text"
placeholder="(à discuter)"
placeholder="(Description)"
/>
</div>
@ -39,16 +28,17 @@
<script setup lang="ts">
import { ref } from "vue";
import { postApi } from "@/services/api.ts";
import Project from "@/ApiClasses/Project";
import { addProjectManually } from "@/services/Apis/Admin";
const project = ref({
projectName: "",
creationDate: "",
logo: "to be discussed not yet fixed",
});
const project = ref(new Project({}));
function submitProject() {
postApi("/admin/projects/add", project.value);
addProjectManually(
project.value.toCreatePayload(),
(res) => console.log("Success:", res.data),
(err) => console.error("Error:", err)
);
}
</script>