Update unit testing patvisit
This commit is contained in:
parent
a9ae893c16
commit
444195cb20
@ -45,7 +45,7 @@ class PatVisit extends BaseController {
|
||||
public function update() {
|
||||
$input = $this->request->getJSON(true);
|
||||
try {
|
||||
if(empty($input)){throw new \Exception('Input data is empty or invalid');}
|
||||
// if(empty($input)){throw new \Exception('Input data is empty or invalid');}
|
||||
if (!$input["InternalPVID"] || !is_numeric($input["InternalPVID"])) { return $this->respond(['status' => 'error', 'message' => 'Invalid or missing ID'], 400); }
|
||||
$data = $this->model->updatePatVisit($input);
|
||||
return $this->respond(['status' => 'success', 'message' => 'Data updated successfully', 'data' => $data], 201);
|
||||
@ -57,7 +57,7 @@ class PatVisit extends BaseController {
|
||||
public function create() {
|
||||
$input = $this->request->getJSON(true);
|
||||
try {
|
||||
if(empty($input)){throw new \Exception('Input data is empty or invalid');}
|
||||
// if(empty($input)){throw new \Exception('Input data is empty or invalid');}
|
||||
$data = $this->model->createPatVisit($input);
|
||||
return $this->respond(['status' => 'success', 'message' => 'Data created successfully', 'data' => $data], 201);
|
||||
} catch (\Exception $e) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user