-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ add application patch feature
- Loading branch information
1 parent
613a555
commit 67c73ee
Showing
17 changed files
with
269 additions
and
312 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
VITE_RDA_KEYCLOAK_AUTH_SERVER_URL=http://localhost:8082 | ||
VITE_RDA_KEYCLOAK_REALM=referentiel-applications | ||
VITE_RDA_KEYCLOAK_CLIENT_ID=referentiel-applications | ||
VITE_RDA_API_URL=http://localhost:8080 | ||
VITE_RDA_API_URL=http://localhost:3500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,37 @@ | ||
<script setup lang="ts"> | ||
import type { Application } from "@/models/Application"; | ||
import useToaster from "@/composables/use-toaster"; | ||
import axios from "axios"; | ||
const props = defineProps<{ application: Application }>(); | ||
const loading = ref(false); | ||
const toaster = useToaster(); | ||
function patchApplication(event: Event) { | ||
loading.value = true; | ||
axios | ||
.patch(`/applications/${props.application.id}`, { | ||
label: props.application.label, | ||
shortName: props.application.shortName, | ||
description: props.application.description, | ||
}) | ||
.then(() => { | ||
toaster.addSuccessMessage("Application mise à jour avec succès"); | ||
}) | ||
.catch((error) => { | ||
toaster.addErrorMessage("Erreur lors de la mise à jour de l'application"); | ||
}) | ||
.finally(() => { | ||
loading.value = false; | ||
}); | ||
} | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<h3>Informations générales</h3> | ||
<p><strong>Identifiant unique :</strong> {{ application.id }}</p> | ||
<p><strong>Nom court :</strong> {{ application.label }}</p> | ||
<p><strong>Nom abrégé :</strong> {{ application.shortName }}</p> | ||
<p><strong>Logo :</strong> {{ application.logo }}</p> | ||
</div> | ||
<h3>Informations générales</h3> | ||
<div class="fr-mb-3w"><DsfrInput v-model="application.id" label="Identifiant unique" label-visible disabled /></div> | ||
<div class="fr-mb-3w"><DsfrInput v-model="application.label" label="Nom" label-visible required /></div> | ||
<div class="fr-mb-3w"><DsfrInput v-model="application.shortName" label="Nom abrégé" label-visible required /></div> | ||
<div class="fr-mb-3w"><DsfrInput v-model="application.description" label="Description" label-visible required isTextarea /></div> | ||
<DsfrButton label="Sauvegarder" primary @click="patchApplication" /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.