fix: create view form (#1691)

This commit is contained in:
Aaryan Khandelwal 2023-07-27 21:38:16 +05:30 committed by GitHub
parent 0cc4468091
commit bedc3ab5a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,20 +60,20 @@ export const ViewForm: React.FC<Props> = ({
const filters = watch("query"); const filters = watch("query");
const { data: stateGroups } = useSWR( const { data: stateGroups } = useSWR(
workspaceSlug && projectId && (filters.state ?? []).length > 0 workspaceSlug && projectId && (filters?.state ?? []).length > 0
? STATES_LIST(projectId as string) ? STATES_LIST(projectId as string)
: null, : null,
workspaceSlug && (filters.state ?? []).length > 0 workspaceSlug && (filters?.state ?? []).length > 0
? () => stateService.getStates(workspaceSlug as string, projectId as string) ? () => stateService.getStates(workspaceSlug as string, projectId as string)
: null : null
); );
const states = getStatesList(stateGroups); const states = getStatesList(stateGroups);
const { data: labels } = useSWR( const { data: labels } = useSWR(
workspaceSlug && projectId && (filters.labels ?? []).length > 0 workspaceSlug && projectId && (filters?.labels ?? []).length > 0
? PROJECT_ISSUE_LABELS(projectId.toString()) ? PROJECT_ISSUE_LABELS(projectId.toString())
: null, : null,
workspaceSlug && projectId && (filters.labels ?? []).length > 0 workspaceSlug && projectId && (filters?.labels ?? []).length > 0
? () => issuesService.getIssueLabels(workspaceSlug.toString(), projectId.toString()) ? () => issuesService.getIssueLabels(workspaceSlug.toString(), projectId.toString())
: null : null
); );