Renamed nullable utils into isDefined and isUndefinedOrNull (#4402)
* Renamed nullable utils into isDefined and isUndefinedOrNull
This commit is contained in:
@ -18,7 +18,7 @@ import {
|
||||
useCheckoutSessionMutation,
|
||||
useGetProductPricesQuery,
|
||||
} from '~/generated/graphql.tsx';
|
||||
import { isNonNullable } from '~/utils/isNonNullable';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
const StyledChoosePlanContainer = styled.div`
|
||||
display: flex;
|
||||
@ -76,7 +76,7 @@ export const ChooseYourPlan = () => {
|
||||
(price) => price.recurringInterval === 'month',
|
||||
)?.[0];
|
||||
if (
|
||||
isNonNullable(monthPrice) &&
|
||||
isDefined(monthPrice) &&
|
||||
isNumber(monthPrice.unitAmount) &&
|
||||
monthPrice.unitAmount > 0 &&
|
||||
isNumber(price.unitAmount) &&
|
||||
|
||||
@ -21,7 +21,7 @@ import { MainButton } from '@/ui/input/button/components/MainButton';
|
||||
import { TextInput } from '@/ui/input/components/TextInput';
|
||||
import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser';
|
||||
import { useActivateWorkspaceMutation } from '~/generated/graphql';
|
||||
import { isNonNullable } from '~/utils/isNonNullable';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
const StyledContentContainer = styled.div`
|
||||
width: 100%;
|
||||
@ -82,7 +82,7 @@ export const CreateWorkspace = () => {
|
||||
include: [FIND_MANY_OBJECT_METADATA_ITEMS],
|
||||
});
|
||||
|
||||
if (isNonNullable(result.errors)) {
|
||||
if (isDefined(result.errors)) {
|
||||
throw result.errors ?? new Error('Unknown error');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user