Skip to content

Commit

Permalink
clients/web: use scalar organization_id filter on products queries
Browse files Browse the repository at this point in the history
This reverts commit 04339ab.
  • Loading branch information
frankie567 committed Jul 9, 2024
1 parent 74670a5 commit 913fb30
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default async function Page({

api.products.list(
{
organizationId: [organization.id],
organizationId: organization.id,
isRecurring: true,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default async function Layout({
api.products
.list(
{
organizationId: [organization.id],
organizationId: organization.id,
isRecurring: true,
},
cacheConfig,
Expand Down
2 changes: 1 addition & 1 deletion clients/apps/web/src/app/[organization]/(sidebar)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export default async function Page({
),
api.products.list(
{
organizationId: [organization.id],
organizationId: organization.id,
isRecurring: true,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export default async function Page({

try {
products = await api.products.list(
{ organizationId: [article.organization_id], isRecurring: true },
{ organizationId: article.organization_id, isRecurring: true },
cacheConfig,
)
} catch (e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default async function Page({
}

const products = await api.products.list(
{ organizationId: [organization.id], isRecurring: false },
{ organizationId: organization.id, isRecurring: false },
{
...cacheConfig,
next: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default async function Page({
)
products = await api.products.list(
{
organizationId: [organization.id],
organizationId: organization.id,
isRecurring: true,
limit: 100,
},
Expand Down
2 changes: 1 addition & 1 deletion clients/apps/web/src/app/[organization]/[repo]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export default async function Page({
}),
api.products.list(
{
organizationId: [repository.organization.id],
organizationId: repository.organization.id,
isRecurring: true,
},
cacheConfig,
Expand Down
2 changes: 1 addition & 1 deletion clients/apps/web/src/app/[organization]/subscribe/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default async function Page({
)
products = await api.products.list(
{
organizationId: [organization.id],
organizationId: organization.id,
isRecurring: true,
},
cacheConfig,
Expand Down
6 changes: 3 additions & 3 deletions clients/apps/web/src/hooks/queries/products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const useProducts = (
queryKey: ['products', { organizationId, ...(parameters || {}) }],
queryFn: () =>
api.products.list({
organizationId: organizationId ? [organizationId] : [],
organizationId: organizationId ?? '',
limit,
...(parameters || {}),
}),
Expand All @@ -35,7 +35,7 @@ export const useBenefitProducts = (
queryKey: ['products', { organizationId, benefitId }],
queryFn: () =>
api.products.list({
organizationId: organizationId ? [organizationId] : [],
organizationId: organizationId ?? '',
benefitId: benefitId ?? '',
limit,
}),
Expand All @@ -61,7 +61,7 @@ export const useFreeTier = (organizationId?: string) =>
queryFn: () =>
api.products
.list({
organizationId: organizationId ? [organizationId] : [],
organizationId: organizationId ?? '',
type: SubscriptionTierType.FREE,
})
.then((res) => res.items?.[0]),
Expand Down

0 comments on commit 913fb30

Please sign in to comment.