From 348f6694610c5d9dff974119d2acd899b926c181 Mon Sep 17 00:00:00 2001 From: vsumit89 Date: Sun, 4 Sep 2022 22:37:09 +0530 Subject: [PATCH] fixed the dega-api issue --- studio/src/pages/claims/CreateClaim.js | 30 +++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/studio/src/pages/claims/CreateClaim.js b/studio/src/pages/claims/CreateClaim.js index e698d743e..4f0d06350 100644 --- a/studio/src/pages/claims/CreateClaim.js +++ b/studio/src/pages/claims/CreateClaim.js @@ -1,9 +1,10 @@ import React from 'react'; import ClaimCreateForm from './components/ClaimForm'; -import { useDispatch } from 'react-redux'; +import { useDispatch, useSelector } from 'react-redux'; import { createClaim } from '../../actions/claims'; -import { useHistory } from 'react-router-dom'; +import { Link, useHistory } from 'react-router-dom'; import { Helmet } from 'react-helmet'; +import { Button, Result } from 'antd'; function CreateClaim() { const history = useHistory(); @@ -12,10 +13,33 @@ function CreateClaim() { const onCreate = (values) => { dispatch(createClaim(values)).then(() => history.push('/claims')); }; + + const { claimantsCount } = useSelector(({ claimants }) => { + return { + claimantsCount: (claimants?.req?.[0]?.data) ? claimants?.req?.[0]?.data : 0 + } + }) + return ( <> - + { + claimantsCount ? ( + + ) + : ( + + + + } + /> + ) + } ); }