Skip to content

Commit

Permalink
fix some nullable issue
Browse files Browse the repository at this point in the history
  • Loading branch information
erfan-goodarzi committed Aug 14, 2023
1 parent 945dcbc commit 62c835b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions app/Dashboard/Households/HouseholdList/HouseholdList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const HouseholdList = () => {
const { data, loading, error } = useHouseholdListQuery({
variables: { orderBy: sorting },
});
const households = data?.household;
const households = data?.household ?? null;

const columns = [
householdColumnHelper.display({
Expand Down Expand Up @@ -76,14 +76,13 @@ export const HouseholdList = () => {
];

const table = useReactTable({
data: households!,
data: households ?? [],
columns,
state: {
sorting,
},
onSortingChange: setSorting,
getCoreRowModel: getCoreRowModel(),
enableSorting: true,
getSortedRowModel: getSortedRowModel(),
});

Expand Down
6 changes: 3 additions & 3 deletions app/Dashboard/Projects/ProjectList/ProjectList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const t = messages.projects.list;

export const ProjectList = () => {
const { data, loading, error } = useProjectListQuery();
const projects = data?.projects;
const projects = data?.projects ?? null;

const columns = [
projectColumnHelper.display({
Expand All @@ -52,7 +52,7 @@ export const ProjectList = () => {
header: t.table.columns.fullDate,
cell: date => (
<DateSummery
startDate={date.getValue()?.startDate ?? null}
startDate={date.getValue()?.startDate}
endDate={date.getValue()?.endDate}
/>
),
Expand All @@ -74,7 +74,7 @@ export const ProjectList = () => {
];

const table = useReactTable({
data: projects!,
data: projects ?? [],
columns,
getCoreRowModel: getCoreRowModel(),
getSortedRowModel: getSortedRowModel(),
Expand Down
2 changes: 1 addition & 1 deletion libs/design/DateSummery/DateSummery.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Text } from '@mantine/core';

interface Props {
startDate: Date | null;
startDate?: Date;
endDate?: Date;
}

Expand Down

0 comments on commit 62c835b

Please sign in to comment.