Bug fix update alamat hospital
This commit is contained in:
@@ -136,11 +136,11 @@ class OrganizationController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
$update_organization->addresses()->updateOrCreate([
|
||||
$newAddres = $update_organization->addresses()->updateOrCreate([
|
||||
'id' => $update_organization->main_address_id
|
||||
], [
|
||||
'use' => 'both',
|
||||
'type' => 'physical',
|
||||
'type' => 'hospital',
|
||||
'text' => $request->address,
|
||||
'province_id' => $request->province_id,
|
||||
'city_id' => $request->city_id,
|
||||
@@ -151,6 +151,10 @@ class OrganizationController extends Controller
|
||||
'lng' => $request->lng,
|
||||
]);
|
||||
|
||||
$update_organization->main_address_id = $newAddres->id;
|
||||
$update_organization->save();
|
||||
|
||||
|
||||
return response()->json([
|
||||
'message' => 'Data berhasil diubah',
|
||||
'data' => new OrganizationResource($update_organization)
|
||||
|
||||
Reference in New Issue
Block a user