From b0c3a9e25b2b14958341e8c99c05b14033675c96 Mon Sep 17 00:00:00 2001 From: arieeefajar Date: Sun, 6 Jul 2025 14:06:12 +0700 Subject: [PATCH] fix(master-rule): fix bug set value edit indicator --- .../Controllers/MasterData/LandController.php | 28 --------------- composer.lock | 36 +++++++++---------- .../customJs/master-data/aturan/petugas.js | 14 -------- 3 files changed, 18 insertions(+), 60 deletions(-) diff --git a/app/Http/Controllers/MasterData/LandController.php b/app/Http/Controllers/MasterData/LandController.php index 5a5f9ab..053ba36 100644 --- a/app/Http/Controllers/MasterData/LandController.php +++ b/app/Http/Controllers/MasterData/LandController.php @@ -102,37 +102,14 @@ public function update(Request $request, $id) 'owner.max' => 'Nama pemilik maksimal 25 karakter', 'owner.string' => 'Nama pemilik harus berupa string', - 'province_id.required' => 'Provinsi wajib diisi', - 'province_id.exists' => 'Provinsi tidak ditemukan', - - 'regency_id.required' => 'Kota wajib diisi', - 'regency_id.exists' => 'Kota tidak ditemukan', - - 'district_id.required' => 'Kecamatan wajib diisi', - 'district_id.exists' => 'Kecamatan tidak ditemukan', - 'address.required' => 'Alamat wajib diisi', 'address.max' => 'Alamat maksimal 100 karakter', 'address.string' => 'Alamat harus berupa string', - - 'lat.required' => 'Latitude wajib diisi', - 'lat.numeric' => 'Latitude harus berupa angka', - - 'lng.required' => 'Longitude wajib diisi', - 'lng.numeric' => 'Longitude harus berupa angka', - - 'polygon.required' => 'Petak lahan wajib digambar', ]; $validator = Validator::make($request->all(), [ 'owner' => 'required|string|max:25', - 'province_id' => 'required|exists:provinces,id', - 'regency_id' => 'required|exists:regencies,id', - 'district_id' => 'required|exists:districts,id', 'address' => 'required|string|max:100', - 'lat' => 'required|numeric', - 'lng' => 'required|numeric', - 'polygon' => 'required', ], $customMessage); $polygon = json_decode($request->polygon, true); @@ -147,12 +124,7 @@ public function update(Request $request, $id) $land = Land::findOrFail($id); $land->user_id = Auth::user()->id; $land->owner = $request->owner; - $land->province_code = $request->province_id; - $land->regency_code = $request->regency_id; - $land->district_code = $request->district_id; $land->address = $request->address; - $land->latitude = $request->lat; - $land->longitude = $request->lng; $land->save(); LandDetails::where('land_id', $land->id)->delete(); diff --git a/composer.lock b/composer.lock index 6bcc347..eb39c37 100644 --- a/composer.lock +++ b/composer.lock @@ -2879,16 +2879,16 @@ }, { "name": "psy/psysh", - "version": "v0.12.8", + "version": "v0.12.9", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "85057ceedee50c49d4f6ecaff73ee96adb3b3625" + "reference": "1b801844becfe648985372cb4b12ad6840245ace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/85057ceedee50c49d4f6ecaff73ee96adb3b3625", - "reference": "85057ceedee50c49d4f6ecaff73ee96adb3b3625", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/1b801844becfe648985372cb4b12ad6840245ace", + "reference": "1b801844becfe648985372cb4b12ad6840245ace", "shasum": "" }, "require": { @@ -2952,9 +2952,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.12.8" + "source": "https://github.com/bobthecow/psysh/tree/v0.12.9" }, - "time": "2025-03-16T03:05:19+00:00" + "time": "2025-06-23T02:35:06+00:00" }, { "name": "ralouphie/getallheaders", @@ -5828,16 +5828,16 @@ }, { "name": "filp/whoops", - "version": "2.18.0", + "version": "2.18.3", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e" + "reference": "59a123a3d459c5a23055802237cb317f609867e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e", - "reference": "a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e", + "url": "https://api.github.com/repos/filp/whoops/zipball/59a123a3d459c5a23055802237cb317f609867e5", + "reference": "59a123a3d459c5a23055802237cb317f609867e5", "shasum": "" }, "require": { @@ -5887,7 +5887,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.18.0" + "source": "https://github.com/filp/whoops/tree/2.18.3" }, "funding": [ { @@ -5895,7 +5895,7 @@ "type": "github" } ], - "time": "2025-03-15T12:00:00+00:00" + "time": "2025-06-16T00:02:10+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -6889,16 +6889,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.46", + "version": "10.5.47", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "8080be387a5be380dda48c6f41cee4a13aadab3d" + "reference": "3637b3e50d32ab3a0d1a33b3b6177169ec3d95a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8080be387a5be380dda48c6f41cee4a13aadab3d", - "reference": "8080be387a5be380dda48c6f41cee4a13aadab3d", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3637b3e50d32ab3a0d1a33b3b6177169ec3d95a3", + "reference": "3637b3e50d32ab3a0d1a33b3b6177169ec3d95a3", "shasum": "" }, "require": { @@ -6970,7 +6970,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.46" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.47" }, "funding": [ { @@ -6994,7 +6994,7 @@ "type": "tidelift" } ], - "time": "2025-05-02T06:46:24+00:00" + "time": "2025-06-20T11:29:11+00:00" }, { "name": "sebastian/cli-parser", diff --git a/public/assets/js/pages/customJs/master-data/aturan/petugas.js b/public/assets/js/pages/customJs/master-data/aturan/petugas.js index 6f7d844..42934f1 100644 --- a/public/assets/js/pages/customJs/master-data/aturan/petugas.js +++ b/public/assets/js/pages/customJs/master-data/aturan/petugas.js @@ -20,20 +20,6 @@ function updateData(rule) { cf.value = rule.cf; } -function updateData(data) { - var form = document.getElementById("edit-form"); - var indicator = form.querySelector("#indicator-edit-field"); - var category = form.querySelector("#category-edit-field"); - var description = form.querySelector("#description-edit-field"); - var cf = form.querySelector("#cf-edit-field"); - - form.action = "/data-aturan-pengguna/" + data.id; - indicator.value = data.indicator_id; - category.value = data.parameter_type; - description.value = data.description; - cf.value = data.cf; -} - function deleteData(id) { var form = document.getElementById("delete-form"); form.action = "/data-aturan-pengguna/" + id;