add fitur search, edit dan filter claim request
This commit is contained in:
@@ -110,19 +110,23 @@ class ClaimRequestService{
|
||||
}
|
||||
}
|
||||
|
||||
public static function updateClaimRequest($organization_id, $claim_request_id){
|
||||
public static function updateClaimRequest($reason, $submission_date, $claim_request_id){
|
||||
try {
|
||||
$data = [
|
||||
'organization_id' => $organization_id
|
||||
];
|
||||
DB::commit();
|
||||
$update = ClaimRequest::where('id', $claim_request_id)->update($data);
|
||||
return ClaimRequest::find($claim_request_id);
|
||||
|
||||
$claimRequest = ClaimRequest::find($claim_request_id);
|
||||
|
||||
if (!$claimRequest) {
|
||||
throw new \Exception("Claim request not found");
|
||||
}
|
||||
|
||||
$claimRequest->submission_date = $submission_date;
|
||||
$claimRequest->reason = $reason;
|
||||
|
||||
$claimRequest->save();
|
||||
|
||||
return $claimRequest;
|
||||
|
||||
} catch (\Exception $error) {
|
||||
DB::rollBack();
|
||||
|
||||
throw new \Exception($error);
|
||||
throw new \Exception($error->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user