fix update organization controller
This commit is contained in:
parent
112e6ec311
commit
6b9261f853
@ -63,7 +63,7 @@ class Department extends BaseController {
|
|||||||
$input = $this->request->getJSON(true);
|
$input = $this->request->getJSON(true);
|
||||||
try {
|
try {
|
||||||
$id = $input['DepartmentID'];
|
$id = $input['DepartmentID'];
|
||||||
$this->model->where('DepartmentID', $id)->update();
|
$this->model->update($id, $input);
|
||||||
return $this->respondCreated([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 201);
|
return $this->respondCreated([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 201);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return $this->failServerError('Something went wrong: ' . $e->getMessage());
|
return $this->failServerError('Something went wrong: ' . $e->getMessage());
|
||||||
|
|||||||
@ -61,12 +61,18 @@ class Discipline extends BaseController {
|
|||||||
|
|
||||||
public function update() {
|
public function update() {
|
||||||
$input = $this->request->getJSON(true);
|
$input = $this->request->getJSON(true);
|
||||||
|
$id = $input['DisciplineID'];
|
||||||
|
$this->model->update($id, $input);
|
||||||
|
return $this->respondCreated([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 201);
|
||||||
|
/*
|
||||||
try {
|
try {
|
||||||
$id = $input['DisciplineID'];
|
$id = $input['DisciplineID'];
|
||||||
$this->model->where('DisciplineID', $id)->update();
|
$this->model->where('DisciplineID', $id)->update();
|
||||||
|
echo $this->model->getLastQuery();
|
||||||
return $this->respondCreated([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 201);
|
return $this->respondCreated([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 201);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return $this->failServerError('Something went wrong: ' . $e->getMessage());
|
return $this->failServerError('Something went wrong: ' . $e->getMessage() );
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -63,7 +63,7 @@ class Workbench extends BaseController {
|
|||||||
$input = $this->request->getJSON(true);
|
$input = $this->request->getJSON(true);
|
||||||
try {
|
try {
|
||||||
$id = $input['WorkbenchID'];
|
$id = $input['WorkbenchID'];
|
||||||
$this->model->where('WorkbenchID', $id)->update();
|
$this->model->update($id, $input);
|
||||||
return $this->respondCreated([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 201);
|
return $this->respondCreated([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 201);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return $this->failServerError('Something went wrong: ' . $e->getMessage());
|
return $this->failServerError('Something went wrong: ' . $e->getMessage());
|
||||||
|
|||||||
@ -63,7 +63,7 @@ class Workstation extends BaseController {
|
|||||||
$input = $this->request->getJSON(true);
|
$input = $this->request->getJSON(true);
|
||||||
try {
|
try {
|
||||||
$id = $input['WorkstationID'];
|
$id = $input['WorkstationID'];
|
||||||
$this->model->where('WorkstationID', $id)->update();
|
$this->model->update($id, $input);
|
||||||
return $this->respondCreated([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 201);
|
return $this->respondCreated([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 201);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return $this->failServerError('Something went wrong: ' . $e->getMessage());
|
return $this->failServerError('Something went wrong: ' . $e->getMessage());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user