@dile/crud 0.0.68 → 0.0.69

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.
@@ -79,8 +79,10 @@ export class DileAjax extends DileAxios(DileI18nMixin(LitElement)) {
79
79
  const status = res.status;
80
80
  switch (status) {
81
81
  case 422:
82
+ this.dispatchError(res.data.message || this.translations.http_422, res.data, this.getValidationErrors(res.data));
83
+ break;
82
84
  case 400:
83
- this.dispatchError(res.data.message, res.data, this.getValidationErrors(res.data));
85
+ this.dispatchError(res.data.message || this.translations.http_400, res.data, this.getValidationErrors(res.data));
84
86
  break;
85
87
  case 404:
86
88
  if(res.data.message) {
@@ -127,6 +129,8 @@ export class DileAjax extends DileAxios(DileI18nMixin(LitElement)) {
127
129
 
128
130
  dispatchResponse(response) {
129
131
  this.dispatchEvent(new CustomEvent('ajax-response', {
132
+ bubbles: true,
133
+ composed: true,
130
134
  detail: {
131
135
  response
132
136
  }
package/lib/i18n/en.js CHANGED
@@ -1,6 +1,8 @@
1
1
  export const translations = {
2
2
  http_unhandled_success: "Unhandled success server response",
3
3
  http_404: "Not found error",
4
+ http_400: "Bad Request",
5
+ http_422: "Unprocessable Entity",
4
6
  http_401: "Unauthorized",
5
7
  http_405: "Method Not Allowed",
6
8
  http_413: "Content Too Large",
package/lib/i18n/es.js CHANGED
@@ -1,6 +1,8 @@
1
1
  export const translations = {
2
2
  http_unhandled_success: "Respuesta de éxito no procesada",
3
3
  http_404: "Recurso inexistente",
4
+ http_400: "Solicitud incorrecta",
5
+ http_422: "Validación de la solicitud incorrecta",
4
6
  http_401: "No autorizado",
5
7
  http_405: "Método HTTP no permitido",
6
8
  http_413: "Contenido enviado al servidor demasiado largo",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dile/crud",
3
- "version": "0.0.68",
3
+ "version": "0.0.69",
4
4
  "description": "Components to create a generic crud system based on Web Components and Lit",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -24,12 +24,12 @@
24
24
  },
25
25
  "homepage": "https://dile-components.polydile.com/",
26
26
  "dependencies": {
27
- "@dile/ui": "^2.1.37",
27
+ "@dile/ui": "^2.1.38",
28
28
  "axios": "^1.7.2",
29
29
  "lit": "^2.7.0 || ^3.0.0"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"
33
33
  },
34
- "gitHead": "98d572545dae6e89cda4f2240bc0e5caface20e0"
34
+ "gitHead": "2800729c7bdb8f152e5a693851b323916feb9e79"
35
35
  }