Skip to content

Commit

Permalink
Update ApiVoucherSetMerchantTeamApprovalRequestController.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ok200paul committed Sep 18, 2024
1 parent b1f4ce0 commit df27c5b
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function store(): JsonResponse
public function show(string $id)
{
$this->query = VoucherSetMerchantTeamApprovalRequest::where('merchant_user_id', Auth::id())
->with($this->associatedData);
->with($this->associatedData);
$this->query = $this->updateReadQueryBasedOnUrl();
$this->data = $this->query->find($id);

Expand All @@ -131,7 +131,11 @@ public function update(string $id)
'approval_status' => [
'required',
'string',
Rule::in([VoucherSetMerchantTeamApprovalRequestStatus::APPROVED->value, VoucherSetMerchantTeamApprovalRequestStatus::REJECTED->value]),
Rule::in(
[
VoucherSetMerchantTeamApprovalRequestStatus::APPROVED->value,
VoucherSetMerchantTeamApprovalRequestStatus::REJECTED->value
]),
],
];

Expand All @@ -141,10 +145,9 @@ public function update(string $id)

$this->responseCode = 400;
$this->message = $validator->errors()
->first();
->first();

}
else {
} else {

try {

Expand All @@ -155,8 +158,7 @@ public function update(string $id)
$this->responseCode = 404;
$this->message = ApiResponse::RESPONSE_NOT_FOUND->value;

}
else {
} else {

foreach ($validationArray as $key => $validationRule) {
$value = $this->request->get($key);
Expand All @@ -183,8 +185,7 @@ public function update(string $id)

}

}
catch (Exception $e) {
} catch (Exception $e) {

$this->responseCode = 500;
$this->message = ApiResponse::RESPONSE_ERROR->value . ': "' . $e->getMessage() . '".';
Expand Down

0 comments on commit df27c5b

Please sign in to comment.