Merge remote-tracking branch 'origin/staging' into origin/production

This commit is contained in:
Linksehat Staging Server
2024-01-22 13:47:21 +07:00

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',