Merge branch 'front_foundation' of https://gitea.piair.dev/piair/MyINPulse into front_foundation
This commit is contained in:
commit
ae36549de9
@ -1,13 +1,8 @@
|
||||
spring.application.name=myinpulse
|
||||
spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://localhost:7080/realms/test/protocol/openid-connect/certs
|
||||
spring.security.oauth2.resourceserver.jwt.issuer-uri=http://localhost:7080/realms/test
|
||||
|
||||
logging.pattern.console=%d{yyyy-MMM-dd HH:mm:ss.SSS} [%thread] %highlight(%-5level) %cyan(%logger{15}) - %msg %n
|
||||
|
||||
spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1
|
||||
spring.datasource.driverClassName=org.h2.Driver
|
||||
spring.datasource.username=sa
|
||||
spring.datasource.password=
|
||||
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
|
||||
|
||||
spring.jpa.hibernate.ddl-auto=create
|
||||
spring.datasource.url=jdbc:postgresql://${DATABASE_URL}/${BACKEND_DB}
|
||||
spring.datasource.username=${BACKEND_USER}
|
||||
spring.datasource.password=${BACKEND_PASSWORD}
|
||||
spring.jpa.hibernate.ddl-auto=update
|
||||
logging.pattern.console=%d{yyyy-MMM-dd HH:mm:ss.SSS} [%thread] %highlight(%-5level) %cyan(%logger{15}) - %msg %n
|
@ -0,0 +1,13 @@
|
||||
spring.application.name=myinpulse
|
||||
spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://localhost:7080/realms/test/protocol/openid-connect/certs
|
||||
spring.security.oauth2.resourceserver.jwt.issuer-uri=http://localhost:7080/realms/test
|
||||
|
||||
logging.pattern.console=%d{yyyy-MMM-dd HH:mm:ss.SSS} [%thread] %highlight(%-5level) %cyan(%logger{15}) - %msg %n
|
||||
|
||||
spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1
|
||||
spring.datasource.driverClassName=org.h2.Driver
|
||||
spring.datasource.username=sa
|
||||
spring.datasource.password=
|
||||
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
|
||||
|
||||
spring.jpa.hibernate.ddl-auto=create
|
@ -37,6 +37,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
createAppointmentReport,
|
||||
updateAppointmentReport,
|
||||
} from "@/services/Apis/Admin";
|
||||
|
||||
export default {
|
||||
name: "AdminAppointmentsComponent",
|
||||
data() {
|
||||
@ -63,28 +68,21 @@ export default {
|
||||
this.appointmentId--;
|
||||
}
|
||||
},
|
||||
async submitReport() {
|
||||
const reportData = {
|
||||
reportContent: this.reportContent,
|
||||
};
|
||||
|
||||
const url = `/admin/appointments/report/${this.appointmentId}`;
|
||||
const method = this.isUpdate ? "PUT" : "POST";
|
||||
|
||||
try {
|
||||
const response = await this.$axios({
|
||||
method,
|
||||
url,
|
||||
data: reportData,
|
||||
});
|
||||
|
||||
submitReport() {
|
||||
const reportData = { content: this.reportContent };
|
||||
const onSuccess = (response) => {
|
||||
if (response.status === 201 || response.status === 200) {
|
||||
this.responseMessage =
|
||||
"Rapport " +
|
||||
(this.isUpdate ? "mis à jour" : "créé") +
|
||||
" avec succès.";
|
||||
}
|
||||
} catch (error) {
|
||||
};
|
||||
const onError = (error) => {
|
||||
console.error(
|
||||
"Erreur lors de l'envoi du rapport :",
|
||||
error.response || error.message
|
||||
);
|
||||
if (error.response && error.response.status === 400) {
|
||||
this.responseMessage =
|
||||
"Requête invalide. Vérifiez les informations.";
|
||||
@ -95,6 +93,22 @@ export default {
|
||||
this.responseMessage =
|
||||
"Une erreur est survenue. Veuillez réessayer.";
|
||||
}
|
||||
};
|
||||
|
||||
if (this.isUpdate) {
|
||||
updateAppointmentReport(
|
||||
this.appointmentId,
|
||||
reportData,
|
||||
onSuccess,
|
||||
onError
|
||||
);
|
||||
} else {
|
||||
createAppointmentReport(
|
||||
this.appointmentId,
|
||||
reportData,
|
||||
onSuccess,
|
||||
onError
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user