Skip to content

Commit

Permalink
clients/web: fix typing issues following SDK update
Browse files Browse the repository at this point in the history
  • Loading branch information
frankie567 committed Dec 20, 2024
1 parent f88c8ba commit c9e51b9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 26 deletions.
4 changes: 2 additions & 2 deletions clients/apps/web/src/components/Notifications/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
MaintainerPledgePendingNotification,
MaintainerPledgedIssueConfirmationPendingNotification,
MaintainerPledgedIssuePendingNotification,
NotificationsInner,
NotificationsListNotificationsInner,
PledgerPledgePendingNotification,
RewardPaidNotification,
TeamAdminMemberPledgedNotification,
Expand All @@ -37,7 +37,7 @@ import Icon from '../Icons/Icon'
import { Modal } from '../Modal'
import { useModal } from '../Modal/useModal'

type NotificationSchema = NotificationsInner
type NotificationSchema = NotificationsListNotificationsInner

const Popover = () => {
const [show, setShow] = useState(false)
Expand Down
23 changes: 10 additions & 13 deletions clients/apps/web/src/hooks/queries/checkout_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import {
CheckoutLinksApiListRequest,
CheckoutLinksApiUpdateRequest,
ListResourceCheckoutLink,
OrganizationIDFilter,
OrganizationIDFilter1,
} from '@polar-sh/sdk'
import { defaultRetry } from './retry'

export const useCheckoutLinks = (
organizationId: OrganizationIDFilter,
organizationId: OrganizationIDFilter1,
parameters?: Omit<CheckoutLinksApiListRequest, 'organizationId'>,
) =>
useQuery({
Expand All @@ -33,10 +33,7 @@ export const useCreateCheckoutLink = () =>
onSuccess: (result, _variables, _ctx) => {
queryClient.setQueriesData<ListResourceCheckoutLink>(
{
queryKey: [
'checkout_links',
{ productId: result.product.id },
],
queryKey: ['checkout_links', { productId: result.product.id }],
},
(old) => {
if (!old) {
Expand Down Expand Up @@ -69,10 +66,7 @@ export const useUpdateCheckoutLink = () =>
onSuccess: (result, _variables, _ctx) => {
queryClient.setQueriesData<ListResourceCheckoutLink>(
{
queryKey: [
'checkout_links',
{ productId: result.product.id },
],
queryKey: ['checkout_links', { productId: result.product.id }],
},
(old) => {
if (!old) {
Expand Down Expand Up @@ -105,9 +99,12 @@ export const useDeleteCheckoutLink = () =>
},
onSuccess: (_result, variables, _ctx) => {
queryClient.invalidateQueries({
queryKey: ['checkout_links', {
productId: variables.product.id
}],
queryKey: [
'checkout_links',
{
productId: variables.product.id,
},
],
})
},
})
4 changes: 2 additions & 2 deletions clients/apps/web/src/hooks/queries/products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import revalidate from '@/app/actions'
import { api, queryClient } from '@/utils/api'
import {
Organization,
OrganizationIDFilter,
OrganizationIDFilter1,
ProductBenefitsUpdate,
ProductCreate,
ProductUpdate,
Expand All @@ -12,7 +12,7 @@ import { useMutation, useQuery } from '@tanstack/react-query'
import { defaultRetry } from './retry'

export const useProducts = (
organizationId?: OrganizationIDFilter,
organizationId?: OrganizationIDFilter1,
parameters?: Omit<ProductsApiListRequest, 'organizationId'>,
) =>
useQuery({
Expand Down
18 changes: 9 additions & 9 deletions clients/apps/web/src/utils/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ export const getGitHubAuthorizeURL = (
params: IntegrationsGithubApiIntegrationsGithubAuthorizeRequest,
): string => {
const searchParams = new URLSearchParams()
if (params.paymentIntentId !== undefined) {
if (params.paymentIntentId) {
searchParams.set('payment_intent_id', params.paymentIntentId)
}
if (params.returnTo !== undefined) {
if (params.returnTo) {
searchParams.set('return_to', params.returnTo)
}
if (params.attribution !== undefined) {
if (params.attribution) {
searchParams.set('attribution', params.attribution)
}
return `${getServerURL()}/v1/integrations/github/authorize?${searchParams}`
Expand All @@ -28,10 +28,10 @@ export const getGoogleAuthorizeURL = (
params: IntegrationsGoogleApiIntegrationsGoogleAuthorizeRequest,
): string => {
const searchParams = new URLSearchParams()
if (params.returnTo !== undefined) {
if (params.returnTo) {
searchParams.set('return_to', params.returnTo)
}
if (params.attribution !== undefined) {
if (params.attribution) {
searchParams.set('attribution', params.attribution)
}
return `${getServerURL()}/v1/integrations/google/authorize?${searchParams}`
Expand All @@ -41,7 +41,7 @@ export const getGitHubOrganizationInstallationURL = (
params: IntegrationsGithubApiRedirectToOrganizationInstallationRequest,
): string => {
const searchParams = new URLSearchParams()
if (params.returnTo !== undefined) {
if (params.returnTo) {
searchParams.set('return_to', params.returnTo)
}
return `${getServerURL()}/v1/integrations/github/organizations/${
Expand All @@ -53,7 +53,7 @@ export const getMagicLinkAuthenticateURL = (
params: MagicLinkApiMagicLinkAuthenticateRequest,
): string => {
const searchParams = new URLSearchParams({ token: params.token })
if (params.returnTo !== undefined) {
if (params.returnTo) {
searchParams.set('return_to', params.returnTo)
}
return `${getServerURL()}/v1/magic_link/authenticate?${searchParams}`
Expand All @@ -63,7 +63,7 @@ export const getBotDiscordAuthorizeURL = (
params: IntegrationsDiscordApiIntegrationsDiscordBotAuthorizeRequest,
): string => {
const searchParams = new URLSearchParams()
if (params.returnTo !== undefined) {
if (params.returnTo) {
searchParams.set('return_to', params.returnTo)
}
return `${getServerURL()}/v1/integrations/discord/bot/authorize?${searchParams}`
Expand All @@ -73,7 +73,7 @@ export const getGitHubRepositoryBenefitAuthorizeURL = (
params: IntegrationsGithubRepositoryBenefitApiIntegrationsGithubRepositoryBenefitUserAuthorizeRequest,
): string => {
const searchParams = new URLSearchParams()
if (params.returnTo !== undefined) {
if (params.returnTo) {
searchParams.set('return_to', params.returnTo)
}
return `${getServerURL()}/v1/integrations/github_repository_benefit/user/authorize?${searchParams}`
Expand Down

0 comments on commit c9e51b9

Please sign in to comment.