Chore(front): Add more typeguards (#2136)
* Chore(front): Add more typeguards Co-authored-by: Benjamin Mayanja V <vibenjamin6@gmail.com> Co-authored-by: KlingerMatheus <klinger.matheus@gitstart.dev> * Remove source map generation to avoid warnings --------- Co-authored-by: Benjamin Mayanja V <vibenjamin6@gmail.com> Co-authored-by: KlingerMatheus <klinger.matheus@gitstart.dev> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useNavigate, useSearchParams } from 'react-router-dom';
|
||||
import { isNonEmptyString } from '@sniptt/guards';
|
||||
|
||||
import { useAuth } from '@/auth/hooks/useAuth';
|
||||
import { useIsLogged } from '@/auth/hooks/useIsLogged';
|
||||
|
||||
import { AppPath } from '../../modules/types/AppPath';
|
||||
import { isNonEmptyString } from '../../utils/isNonEmptyString';
|
||||
|
||||
export const VerifyEffect = () => {
|
||||
const [searchParams] = useSearchParams();
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { useCallback, useEffect } from 'react';
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
import { isNonEmptyString } from '@sniptt/guards';
|
||||
import { useRecoilState, useSetRecoilState } from 'recoil';
|
||||
|
||||
import { useIsLogged } from '@/auth/hooks/useIsLogged';
|
||||
@ -8,7 +9,6 @@ import { tokenPairState } from '@/auth/states/tokenPairState';
|
||||
import { useImpersonateMutation } from '~/generated/graphql';
|
||||
|
||||
import { AppPath } from '../../modules/types/AppPath';
|
||||
import { isNonEmptyString } from '../../utils/isNonEmptyString';
|
||||
|
||||
export const ImpersonateEffect = () => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { getOperationName } from '@apollo/client/utilities';
|
||||
import { isString } from '@sniptt/guards';
|
||||
import { expect } from '@storybook/jest';
|
||||
import { Meta } from '@storybook/react';
|
||||
import { userEvent, within } from '@storybook/testing-library';
|
||||
@ -116,7 +117,7 @@ const editRelationMocks = (
|
||||
) => [
|
||||
...graphqlMocks.filter((graphqlMock) => {
|
||||
if (
|
||||
typeof graphqlMock.info.operationName === 'string' &&
|
||||
isString(graphqlMock.info.operationName) &&
|
||||
[
|
||||
getOperationName(UPDATE_ONE_PERSON),
|
||||
getOperationName(SEARCH_COMPANY_QUERY),
|
||||
|
||||
Reference in New Issue
Block a user