broker : GWM
This commit is contained in:
parent
3a57d2adab
commit
c7d68ad680
@ -168,7 +168,7 @@ class PolicyController extends ResourceController
|
||||
public function updatePolicy()
|
||||
{
|
||||
try {
|
||||
$data = $this->request->getPost();
|
||||
$data = $this->request->getJSON(true);
|
||||
if (!isset($data['id'])) {
|
||||
return $this->respond(['status' => 'failed', 'code' => 200, 'data' => 'ID Required'], 200);
|
||||
}
|
||||
@ -440,13 +440,14 @@ class PolicyController extends ResourceController
|
||||
}
|
||||
|
||||
$filePath = WRITEPATH . "uploads/policy/{$folder}/" . $fileRecord[$fileColumn];
|
||||
$publicUrl = base_url("uploads/policy/{$folder}/" . $fileRecord[$fileColumn]);
|
||||
|
||||
if (!file_exists($filePath)) {
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => 'File missing on server'], 200);
|
||||
}
|
||||
|
||||
|
||||
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $filePath ], 200);
|
||||
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $publicUrl ], 200);
|
||||
|
||||
|
||||
} catch (\Exception $e) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user