mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
refactor: partner (#43466)
This commit is contained in:
1 parent
56d97ed7fd
commit
22d706cd17
5 files changed
+50
-50
No files matched your search
@@ -1,3 +1,3 @@
|
||||
export const stripeProductKeys = {
|
||||
get: (arId: string | undefined) => ['stripe', 'product', arId] as const,
|
||||
export const stripeFabricKeys = {
|
||||
get: (arId: string | undefined) => ['stripe', 'fabric', arId] as const,
|
||||
}
|
||||
+1
-1
@@ -12,7 +12,7 @@ async function confirmAccountRequest({ arId }: ConfirmAccountRequestVariables) {
|
||||
if (!arId) throw new Error('Account request ID is required')
|
||||
|
||||
const { data, error } = await post(
|
||||
'/platform/stripe/product/provisioning/account_requests/{id}/confirm',
|
||||
'/platform/stripe/fabric/provisioning/account_requests/{id}/confirm',
|
||||
{
|
||||
params: { path: { id: arId } },
|
||||
}
|
||||
+3
-3
@@ -2,7 +2,7 @@ import { queryOptions } from '@tanstack/react-query'
|
||||
import type { components } from 'api-types'
|
||||
|
||||
import { get, handleError } from '../fetchers'
|
||||
import { stripeProductKeys } from './keys'
|
||||
import { stripeFabricKeys } from './keys'
|
||||
|
||||
type GetAccountRequestVariables = {
|
||||
arId?: string
|
||||
@@ -13,7 +13,7 @@ export type AccountRequestDetails = components['schemas']['AccountRequestDetails
|
||||
async function getAccountRequest({ arId }: GetAccountRequestVariables, signal?: AbortSignal) {
|
||||
if (!arId) throw new Error('Account request ID is required')
|
||||
|
||||
const { data, error } = await get('/platform/stripe/product/provisioning/account_requests/{id}', {
|
||||
const { data, error } = await get('/platform/stripe/fabric/provisioning/account_requests/{id}', {
|
||||
params: { path: { id: arId } },
|
||||
signal,
|
||||
})
|
||||
@@ -27,7 +27,7 @@ export const accountRequestQueryOptions = (
|
||||
{ enabled = true }: { enabled?: boolean } = { enabled: true }
|
||||
) => {
|
||||
return queryOptions({
|
||||
queryKey: stripeProductKeys.get(arId),
|
||||
queryKey: stripeFabricKeys.get(arId),
|
||||
queryFn: ({ signal }) => getAccountRequest({ arId }, signal),
|
||||
enabled: enabled && typeof arId !== 'undefined',
|
||||
})
|
||||
+6
-6
@@ -12,12 +12,12 @@ import {
|
||||
} from 'ui'
|
||||
|
||||
import APIAuthorizationLayout from '@/components/layouts/APIAuthorizationLayout'
|
||||
import { useConfirmAccountRequestMutation } from '@/data/partners/stripe-product-confirm-mutation'
|
||||
import { accountRequestQueryOptions } from '@/data/partners/stripe-product-query'
|
||||
import { useConfirmAccountRequestMutation } from '@/data/partners/stripe-fabric-confirm-mutation'
|
||||
import { accountRequestQueryOptions } from '@/data/partners/stripe-fabric-query'
|
||||
import { withAuth } from '@/hooks/misc/withAuth'
|
||||
import { useSignOut } from '@/lib/auth'
|
||||
|
||||
const StripeProductLoginPage = () => {
|
||||
const StripeFabricLoginPage = () => {
|
||||
const router = useRouter()
|
||||
const { ar_id } = useParams()
|
||||
|
||||
@@ -74,9 +74,9 @@ const StripeProductLoginPage = () => {
|
||||
<LogoLoader />
|
||||
) : isSuccess ? (
|
||||
<>
|
||||
<h2 className="py-2 text-lg font-medium">Stripe Product Account Request</h2>
|
||||
<h2 className="py-2 text-lg font-medium">Stripe Fabric Account Request</h2>
|
||||
<p className="text-center text-foreground-light">
|
||||
Stripe Product wants to create a Supabase organization for{' '}
|
||||
Stripe Fabric wants to create a Supabase organization for{' '}
|
||||
<strong>{accountRequest.email}</strong>
|
||||
{accountRequest.name && <> ({accountRequest.name})</>}.
|
||||
</p>
|
||||
@@ -118,4 +118,4 @@ const StripeProductLoginPage = () => {
|
||||
)
|
||||
}
|
||||
|
||||
export default withAuth(StripeProductLoginPage)
|
||||
export default withAuth(StripeFabricLoginPage)
|
||||
+38
-38
@@ -4320,24 +4320,7 @@ export interface paths {
|
||||
patch?: never
|
||||
trace?: never
|
||||
}
|
||||
'/platform/stripe/invoices/overdue': {
|
||||
parameters: {
|
||||
query?: never
|
||||
header?: never
|
||||
path?: never
|
||||
cookie?: never
|
||||
}
|
||||
/** Gets information about overdue invoices that relate to the authenticated user */
|
||||
get: operations['InvoicesController_getOverdueInvoices']
|
||||
put?: never
|
||||
post?: never
|
||||
delete?: never
|
||||
options?: never
|
||||
head?: never
|
||||
patch?: never
|
||||
trace?: never
|
||||
}
|
||||
'/platform/stripe/product/provisioning/account_requests/{id}': {
|
||||
'/platform/stripe/fabric/provisioning/account_requests/{id}': {
|
||||
parameters: {
|
||||
query?: never
|
||||
header?: never
|
||||
@@ -4354,7 +4337,7 @@ export interface paths {
|
||||
patch?: never
|
||||
trace?: never
|
||||
}
|
||||
'/platform/stripe/product/provisioning/account_requests/{id}/confirm': {
|
||||
'/platform/stripe/fabric/provisioning/account_requests/{id}/confirm': {
|
||||
parameters: {
|
||||
query?: never
|
||||
header?: never
|
||||
@@ -4371,6 +4354,23 @@ export interface paths {
|
||||
patch?: never
|
||||
trace?: never
|
||||
}
|
||||
'/platform/stripe/invoices/overdue': {
|
||||
parameters: {
|
||||
query?: never
|
||||
header?: never
|
||||
path?: never
|
||||
cookie?: never
|
||||
}
|
||||
/** Gets information about overdue invoices that relate to the authenticated user */
|
||||
get: operations['InvoicesController_getOverdueInvoices']
|
||||
put?: never
|
||||
post?: never
|
||||
delete?: never
|
||||
options?: never
|
||||
head?: never
|
||||
patch?: never
|
||||
trace?: never
|
||||
}
|
||||
'/platform/stripe/setup-intent': {
|
||||
parameters: {
|
||||
query?: never
|
||||
@@ -26412,25 +26412,6 @@ export interface operations {
|
||||
}
|
||||
}
|
||||
}
|
||||
InvoicesController_getOverdueInvoices: {
|
||||
parameters: {
|
||||
query?: never
|
||||
header?: never
|
||||
path?: never
|
||||
cookie?: never
|
||||
}
|
||||
requestBody?: never
|
||||
responses: {
|
||||
200: {
|
||||
headers: {
|
||||
[name: string]: unknown
|
||||
}
|
||||
content: {
|
||||
'application/json': components['schemas']['OverdueInvoiceCount'][]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
AccountRequestsController_getAccountRequest: {
|
||||
parameters: {
|
||||
query?: never
|
||||
@@ -26473,6 +26454,25 @@ export interface operations {
|
||||
}
|
||||
}
|
||||
}
|
||||
InvoicesController_getOverdueInvoices: {
|
||||
parameters: {
|
||||
query?: never
|
||||
header?: never
|
||||
path?: never
|
||||
cookie?: never
|
||||
}
|
||||
requestBody?: never
|
||||
responses: {
|
||||
200: {
|
||||
headers: {
|
||||
[name: string]: unknown
|
||||
}
|
||||
content: {
|
||||
'application/json': components['schemas']['OverdueInvoiceCount'][]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SetupIntentController_setUpPaymentMethod: {
|
||||
parameters: {
|
||||
query?: never
|
||||
|
||||
Reference in new issue
Block a user