summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhamza221 <hamzamahjoubi221@gmail.com>2023-05-12 18:35:19 +0200
committerhamza221 <hamzamahjoubi221@gmail.com>2023-05-12 18:35:19 +0200
commitc077554ed958050a3809aae9f352713092f57c42 (patch)
treea3a84720d16e0be0aa249415e5456ab44c7c7215
parenta1889d1a2dc4a67411b3eae7eb75b3aa2db0bed5 (diff)
Fix:Form is transitioned into view mode when saving fails
Signed-off-by: hamza221 <hamzamahjoubi221@gmail.com>
-rw-r--r--src/components/ContactDetails.vue12
-rw-r--r--src/store/contacts.js1
2 files changed, 9 insertions, 4 deletions
diff --git a/src/components/ContactDetails.vue b/src/components/ContactDetails.vue
index 1903d189..a125073a 100644
--- a/src/components/ContactDetails.vue
+++ b/src/components/ContactDetails.vue
@@ -313,8 +313,6 @@ import PropertySelect from './Properties/PropertySelect.vue'
export default {
name: 'ContactDetails',
- mixins: [isMobile],
-
components: {
ActionButton,
ActionLink,
@@ -341,6 +339,8 @@ export default {
NcButton,
},
+ mixins: [isMobile],
+
props: {
contactKey: {
type: String,
@@ -854,8 +854,12 @@ export default {
* Save the contact. This handler is triggered by the save button.
*/
async onSave() {
- await this.updateContact()
- this.editMode = false
+ try {
+ await this.updateContact()
+ this.editMode = false
+ } catch (error) {
+ showError(t('contacts', 'Unable to update contact'))
+ }
},
},
}
diff --git a/src/store/contacts.js b/src/store/contacts.js
index 58b1c7c5..2f296c09 100644
--- a/src/store/contacts.js
+++ b/src/store/contacts.js
@@ -380,6 +380,7 @@ const actions = {
context.commit('setContactAsConflict', { contact, etag: error.xhr.getResponseHeader('etag') })
console.error('This contact is outdated, the server refused it', contact)
}
+ throw (error)
}
} else {
console.error('This contact is outdated, refusing to push', contact)