[WIP] Fix Failed Creating Limit
This commit is contained in:
@@ -66,6 +66,11 @@ class ClaimController extends Controller
|
|||||||
// Store Claim
|
// Store Claim
|
||||||
if ($validation['isEligible']) {
|
if ($validation['isEligible']) {
|
||||||
$claim = ClaimService::storeClaim($member, $diagnosis, $request->total_claim, $benefit);
|
$claim = ClaimService::storeClaim($member, $diagnosis, $request->total_claim, $benefit);
|
||||||
|
} else {
|
||||||
|
return response()->json([
|
||||||
|
'data' => $validation,
|
||||||
|
'message' => $validation['errors'][0]['message']
|
||||||
|
], 403);
|
||||||
}
|
}
|
||||||
|
|
||||||
return response()->json($claim);
|
return response()->json($claim);
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ export default function ClaimsCreate() {
|
|||||||
navigate('/claims');
|
navigate('/claims');
|
||||||
})
|
})
|
||||||
.catch(function (err) {
|
.catch(function (err) {
|
||||||
console.log('ERROR CUK', err.data)
|
console.log('ERROR CUK', err)
|
||||||
enqueueSnackbar('Failed Creating Claim', { variant: 'error' })
|
enqueueSnackbar('Failed Creating Claim : '+ err.response.data.message, { variant: 'error' })
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -265,7 +265,7 @@ export default function ClaimsCreate() {
|
|||||||
}}
|
}}
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<TextField
|
<TextField
|
||||||
// name="benefit"
|
name="benefit"
|
||||||
{...params}
|
{...params}
|
||||||
label="Benefit"
|
label="Benefit"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
@@ -296,7 +296,7 @@ export default function ClaimsCreate() {
|
|||||||
onChange(newValue);
|
onChange(newValue);
|
||||||
}}
|
}}
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<RHFTextField
|
<TextField
|
||||||
name="diagnosis"
|
name="diagnosis"
|
||||||
{...params}
|
{...params}
|
||||||
label="Diagnosis"
|
label="Diagnosis"
|
||||||
@@ -387,9 +387,6 @@ export default function ClaimsCreate() {
|
|||||||
|
|
||||||
<RHFTextField type="number" name="total_claim" label="Total Claim" />
|
<RHFTextField type="number" name="total_claim" label="Total Claim" />
|
||||||
|
|
||||||
<LoadingButton onClick={handleSubmit(onSubmit)} variant="contained" color="success" style={{color: '#ffffff'}} size="large" fullWidth={true} loading={isCheckingLimit}>
|
|
||||||
Create Claim
|
|
||||||
</LoadingButton>
|
|
||||||
{ isEligible === true ? (
|
{ isEligible === true ? (
|
||||||
<LoadingButton onClick={handleSubmit(onSubmit)} variant="contained" color="success" style={{color: '#ffffff'}} size="large" fullWidth={true} loading={isCheckingLimit}>
|
<LoadingButton onClick={handleSubmit(onSubmit)} variant="contained" color="success" style={{color: '#ffffff'}} size="large" fullWidth={true} loading={isCheckingLimit}>
|
||||||
Create Claim
|
Create Claim
|
||||||
|
|||||||
Reference in New Issue
Block a user