druxt-entity 0.21.4 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # druxt-entity
2
2
 
3
+ ## 0.22.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 7b749bd: Updated DruxtEntityForm error handling.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [7b749bd]
12
+ - druxt@0.16.0
13
+ - druxt-router@0.25.0
14
+ - druxt-schema@0.9.3
15
+
3
16
  ## 0.21.4
4
17
 
5
18
  ### Patch Changes
@@ -92,16 +92,15 @@ export default {
92
92
  if (this.model.id) {
93
93
  method = 'updateResource'
94
94
  }
95
- this.response = await this.$druxt[method](this.model)
96
95
 
97
- // Handle the response
98
- if (!this.response.errors) {
96
+ try {
97
+ this.response = await this.$druxt[method](this.model)
99
98
  const resource = this.response.data.data
100
99
  // Update the Vuex store.
101
100
  this.$store.commit('druxt/addResource', { resource })
102
101
  this.$emit('submit', resource)
103
- }
104
- else {
102
+ } catch (err) {
103
+ this.response = err.response.data
105
104
  this.$emit('error', this.response)
106
105
  }
107
106
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "druxt-entity",
3
- "version": "0.21.4",
3
+ "version": "0.22.0",
4
4
  "description": "Drupal Display Mode powered Entity, Form and Field Druxt components.",
5
5
  "keywords": [
6
6
  "cms",
@@ -46,9 +46,9 @@
46
46
  "dependencies": {
47
47
  "deepmerge": "^4.2.2",
48
48
  "drupal-jsonapi-params": "^1.2.2",
49
- "druxt": "^0.15.0",
50
- "druxt-router": "^0.24.2",
51
- "druxt-schema": "^0.9.2"
49
+ "druxt": "^0.16.0",
50
+ "druxt-router": "^0.25.0",
51
+ "druxt-schema": "^0.9.3"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public"