Browse Source

fix eslint errors

Olivier Massot 6 months ago
parent
commit
e4ed883040
2 changed files with 11 additions and 9 deletions
  1. 10 8
      components/Ui/Form.vue
  2. 1 1
      pages/parameters/subdomains/new.vue

+ 10 - 8
components/Ui/Form.vue

@@ -145,9 +145,9 @@ const props = defineProps({
     default: false,
     default: false,
   },
   },
   /**
   /**
-   * Faut-il rafraichir le profil à la soumission du formulaire?
+   * Faut-il rafraichir le profil à la soumission du formulaire ?
    */
    */
-  refreshProfile: {
+  refreshProfileOnSubmit: {
     type: Boolean,
     type: Boolean,
     required: false,
     required: false,
     default: false,
     default: false,
@@ -230,7 +230,7 @@ const submit = async (next: string | null = null) => {
 
 
     emit('update:model-value', updatedEntity)
     emit('update:model-value', updatedEntity)
 
 
-    if (props.refreshProfile) {
+    if (props.refreshProfileOnSubmit) {
       await refreshProfile()
       await refreshProfile()
     }
     }
 
 
@@ -246,17 +246,19 @@ const submit = async (next: string | null = null) => {
     } else if (next === SUBMIT_TYPE.SAVE_AND_BACK) {
     } else if (next === SUBMIT_TYPE.SAVE_AND_BACK) {
       onSaveAndQuitAction(actionArgs)
       onSaveAndQuitAction(actionArgs)
     }
     }
-  } catch (error: any) {
+  } catch (error: unknown) {
+
+    const err = error as { response?: { status: number, data: { violations?: Array<{ message: string, propertyPath: string }> } } }
     if (
     if (
-      error.response &&
-      error.response.status === 422 &&
-      error.response.data.violations
+      err.response &&
+      err.response.status === 422 &&
+      err.response.data.violations
     ) {
     ) {
       // TODO: à revoir
       // TODO: à revoir
       const violations: Array<string> = []
       const violations: Array<string> = []
       let fields: AnyJson = {}
       let fields: AnyJson = {}
 
 
-      for (const violation of error.response.data.violations) {
+      for (const violation of err.response.data.violations) {
         violations.push(i18n.t(violation.message) as string)
         violations.push(i18n.t(violation.message) as string)
         fields = Object.assign(fields, {
         fields = Object.assign(fields, {
           [violation.propertyPath]: violation.message,
           [violation.propertyPath]: violation.message,

+ 1 - 1
pages/parameters/subdomains/new.vue

@@ -6,7 +6,7 @@
         v-model="subdomain"
         v-model="subdomain"
         :submit-actions="submitActions"
         :submit-actions="submitActions"
         :validation-pending="validationPending"
         :validation-pending="validationPending"
-        :refresh-profile="true"
+        :refresh-profile-on-submit="true"
       >
       >
         <v-container :fluid="true" class="container">
         <v-container :fluid="true" class="container">
           <v-row>
           <v-row>