Bug fix update alamat hospital

This commit is contained in:
2024-01-22 13:45:16 +07:00
parent abc6c33717
commit 7b37a06e20

View File

@@ -136,11 +136,11 @@ class OrganizationController extends Controller
]); ]);
} }
$update_organization->addresses()->updateOrCreate([ $newAddres = $update_organization->addresses()->updateOrCreate([
'id' => $update_organization->main_address_id 'id' => $update_organization->main_address_id
], [ ], [
'use' => 'both', 'use' => 'both',
'type' => 'physical', 'type' => 'hospital',
'text' => $request->address, 'text' => $request->address,
'province_id' => $request->province_id, 'province_id' => $request->province_id,
'city_id' => $request->city_id, 'city_id' => $request->city_id,
@@ -150,6 +150,10 @@ class OrganizationController extends Controller
'lat' => $request->lat, 'lat' => $request->lat,
'lng' => $request->lng, 'lng' => $request->lng,
]); ]);
$update_organization->main_address_id = $newAddres->id;
$update_organization->save();
return response()->json([ return response()->json([
'message' => 'Data berhasil diubah', 'message' => 'Data berhasil diubah',