mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-12 05:51:08 +03:30
update verify access for test result
This commit is contained in:
@@ -374,16 +374,13 @@ class TestResultController extends Controller
|
||||
return \MessageResponse::success(null, trans('messages.success'));
|
||||
}
|
||||
|
||||
public function verifyTestResult(TestResult $TestResult)
|
||||
public function verifyTestResult(TestResult $TestResult, $Value)
|
||||
{
|
||||
if (auth('api')->user()->cant('verifyTestResult', $TestResult)) {
|
||||
return \MessageResponse::error(trans('You dont have permission or this test result belongs to another medical center'));
|
||||
}
|
||||
if ($TestResult->verified == 'Verified') {
|
||||
$TestResult->verified = 'NotVerified';
|
||||
} else {
|
||||
$TestResult->verified = 'Verified';
|
||||
}
|
||||
|
||||
$TestResult->verified = $Value;
|
||||
$TestResult->save();
|
||||
$TestResult = $TestResult->load('user.medical_center');
|
||||
return \MessageResponse::success(trans('messages.success'), null, $TestResult);
|
||||
|
||||
Reference in New Issue
Block a user