Skip to content

Commit

Permalink
Merge pull request #2563 from MTES-MCT/fix/2559-archive-draft-null
Browse files Browse the repository at this point in the history
[FO - Formulaire] Correction pour archiver un draft existant
  • Loading branch information
sfinx13 committed May 17, 2024
2 parents 104398d + 1351a27 commit 1a1696b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions assets/vue/components/signalement-form/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,9 @@ export const requests = {
},

archiveDraft (functionReturn: Function) {
if (formStore.alreadyExists.type === 'draft') {
const url = formStore.props.ajaxurlArchiveDraft.replace('uuid', formStore.alreadyExists.uuid)
requests.doRequestPost(url, '', functionReturn, undefined)
} else if (formStore.alreadyExists.type === 'signalement' && formStore.alreadyExists.uuidDraft !== null) {
if (formStore.alreadyExists.uuidDraft !== null && (
formStore.alreadyExists.type === 'draft' || formStore.alreadyExists.type === 'signalement'
)) {
const url = formStore.props.ajaxurlArchiveDraft.replace('uuid', formStore.alreadyExists.uuidDraft)
requests.doRequestPost(url, '', functionReturn, undefined)
} else {
Expand Down

0 comments on commit 1a1696b

Please sign in to comment.