Skip to content

Commit

Permalink
fix: ajoute un message d'erreur si une version avec même date existe …
Browse files Browse the repository at this point in the history
…déjà

Signed-off-by: Maud Royer <hello@maudroyer.fr>
  • Loading branch information
jillro committed Feb 13, 2024
1 parent af7bc57 commit 5ca8290
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
19 changes: 15 additions & 4 deletions src/components/Certification/Summary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import ValidationErrors from "@/components/Features/ValidationErrors.vue"
import CertificationModal from "@/components/Certification/CertificationModal.vue"
import SendOffModal from "@/components/Certification/SendOffModal.vue"
import { usePermissions } from "@/stores/permissions.js"
import toast from "@/components/toast.js"
const recordStore = useRecordStore()
const permissions = usePermissions()
Expand Down Expand Up @@ -74,11 +75,21 @@ const validationResult = computed(() => applyValidationRules(props.validationRul
const hasFailures = computed(() => Boolean(validationResult.value.failures))
async function handleSaveAudit ({ record_id: recordId, patch }) {
const record = await updateAuditState({ recordId }, {
...patch,
certification_state: CERTIFICATION_STATE.AUDITED
let record
try {
record = await updateAuditState({ recordId }, {
...patch,
certification_state: CERTIFICATION_STATE.AUDITED
}
)
} catch (e) {
if (e.response?.status === 400) {
toast.error(e.response.data.error)
return
}
)
throw e
}
recordStore.update(record)
showSendOffModal.value = false
Expand Down
1 change: 0 additions & 1 deletion src/components/Features/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ async function performAsyncRecordAction (promise, text = 'Modification enregistr
toast.success(text)
}
catch (error) {
console.error(error)
toast.error(
"Une erreur d'enregistrement s'est produite. Les données n'ont pas été sauvegardées sur les serveurs CartoBio."
)
Expand Down

0 comments on commit 5ca8290

Please sign in to comment.