From 7f05e9e22434da85d75af09708ede6164d1ce723 Mon Sep 17 00:00:00 2001 From: Sulfano agus fikri Date: Fri, 9 Apr 2021 09:53:23 +0700 Subject: [PATCH] - bug fix validation - standarize loader --- src/Controllers/Controller.php | 2 +- src/resources/js/pages/menu-management/add.vue | 2 +- src/resources/js/pages/menu-management/edit.vue | 2 +- src/resources/js/pages/permission-management/add.vue | 2 +- src/resources/js/pages/permission-management/edit.vue | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Controllers/Controller.php b/src/Controllers/Controller.php index 565c11765..90e66be75 100644 --- a/src/Controllers/Controller.php +++ b/src/Controllers/Controller.php @@ -77,7 +77,7 @@ public function validateData($data, $data_type) $data_rows = collect($data_type->dataRows)->where('add', 1)->all(); $rules = []; foreach ($data_rows as $row) { - if ($row->required == 0) { + if ($row->required == 1) { $rules[$row->field][] = 'required'; if ($row->type == 'relation') { $relation_detail = []; diff --git a/src/resources/js/pages/menu-management/add.vue b/src/resources/js/pages/menu-management/add.vue index 32d7e6ce4..50d3cfe9d 100644 --- a/src/resources/js/pages/menu-management/add.vue +++ b/src/resources/js/pages/menu-management/add.vue @@ -77,7 +77,7 @@ export default { methods: { submitForm() { this.errors = {}; - this.$vs.loading(); + this.$openLoader(); this.$api.badasoMenu .add(this.menu) .then((response) => { diff --git a/src/resources/js/pages/menu-management/edit.vue b/src/resources/js/pages/menu-management/edit.vue index 1c6df72e0..7849377a1 100644 --- a/src/resources/js/pages/menu-management/edit.vue +++ b/src/resources/js/pages/menu-management/edit.vue @@ -81,7 +81,7 @@ export default { methods: { submitForm() { this.errors = {}; - this.$vs.loading(); + this.$openLoader(); this.$api.badasoMenu .edit(this.menu) .then((response) => { diff --git a/src/resources/js/pages/permission-management/add.vue b/src/resources/js/pages/permission-management/add.vue index 4ed8c5d1f..672675a44 100644 --- a/src/resources/js/pages/permission-management/add.vue +++ b/src/resources/js/pages/permission-management/add.vue @@ -91,7 +91,7 @@ export default { methods: { submitForm() { this.errors = {}; - this.$vs.loading(); + this.$openLoader(); this.$api.badasoPermission .add(this.permission) .then((response) => { diff --git a/src/resources/js/pages/permission-management/edit.vue b/src/resources/js/pages/permission-management/edit.vue index 374f6fa9e..e1ded921a 100644 --- a/src/resources/js/pages/permission-management/edit.vue +++ b/src/resources/js/pages/permission-management/edit.vue @@ -117,7 +117,7 @@ export default { }, submitForm() { this.errors = {}; - this.$vs.loading(); + this.$openLoader(); this.$api.badasoPermission .edit(this.permission) .then((response) => {