mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-23 23:05:46 +00:00
fix(FE-86): fixing error null value
This commit is contained in:
@@ -141,8 +141,8 @@ const AddChickin = () => {
|
|||||||
options={options}
|
options={options}
|
||||||
isLoading={isLoadingListProjectFlock}
|
isLoading={isLoadingListProjectFlock}
|
||||||
value={{
|
value={{
|
||||||
label: `${projectFlock.data.flock.name} - ${projectFlock.data.category} - Periode ${projectFlock.data.period}`,
|
label: `${projectFlock.data?.flock?.name} - ${projectFlock.data?.category} - Periode ${projectFlock.data?.period}`,
|
||||||
value: projectFlock.data.id,
|
value: projectFlock.data?.id,
|
||||||
}}
|
}}
|
||||||
onChange={(val) =>
|
onChange={(val) =>
|
||||||
router.push(
|
router.push(
|
||||||
@@ -159,7 +159,7 @@ const AddChickin = () => {
|
|||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<Table<Kandang>
|
<Table<Kandang>
|
||||||
data={projectFlock.data.kandangs}
|
data={projectFlock.data?.kandangs}
|
||||||
columns={[
|
columns={[
|
||||||
{
|
{
|
||||||
header: '#',
|
header: '#',
|
||||||
@@ -202,7 +202,7 @@ const AddChickin = () => {
|
|||||||
containerClassName: cn({
|
containerClassName: cn({
|
||||||
'mb-20':
|
'mb-20':
|
||||||
isResponseSuccess(projectFlock) &&
|
isResponseSuccess(projectFlock) &&
|
||||||
projectFlock.data.kandangs?.length === 0,
|
projectFlock.data?.kandangs?.length === 0,
|
||||||
}),
|
}),
|
||||||
tableWrapperClassName: 'overflow-x-auto min-h-full!',
|
tableWrapperClassName: 'overflow-x-auto min-h-full!',
|
||||||
tableClassName: 'font-inter w-full table-auto min-h-full!',
|
tableClassName: 'font-inter w-full table-auto min-h-full!',
|
||||||
@@ -239,10 +239,10 @@ const AddChickin = () => {
|
|||||||
<ChickinForm
|
<ChickinForm
|
||||||
initialValues={{
|
initialValues={{
|
||||||
project_flock_kandang: projectFlockKandang.data,
|
project_flock_kandang: projectFlockKandang.data,
|
||||||
created_user: projectFlock.data.created_user,
|
created_user: projectFlock.data?.created_user,
|
||||||
created_at: projectFlock.data.created_at,
|
created_at: projectFlock.data?.created_at,
|
||||||
updated_at: projectFlock.data.updated_at,
|
updated_at: projectFlock.data?.updated_at,
|
||||||
approval: projectFlock.data.approval,
|
approval: projectFlock.data?.approval,
|
||||||
}}
|
}}
|
||||||
afterSubmit={handleAfterSubmit}
|
afterSubmit={handleAfterSubmit}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user