mirror of
https://github.com/vercel/commerce.git
synced 2025-06-07 16:56:59 +00:00
Add get-page operator
Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
parent
29b0e064a9
commit
5de4e77e21
@ -1,11 +1,30 @@
|
||||
export type Page = any
|
||||
export type GetPageResult = { page?: Page }
|
||||
import type {
|
||||
OperationContext,
|
||||
OperationOptions,
|
||||
} from '@vercel/commerce/api/operations'
|
||||
import { GetPageOperation } from '../../types/page'
|
||||
import { Provider, OpenCommerceConfig } from '..'
|
||||
|
||||
export type PageVariables = {
|
||||
id: number
|
||||
}
|
||||
type Page = any
|
||||
type GetPageResult = { page?: Page }
|
||||
|
||||
export default function getPageOperation({
|
||||
commerce,
|
||||
}: OperationContext<Provider>) {
|
||||
async function getPage<T extends GetPageOperation>(opts: {
|
||||
variables: T['variables']
|
||||
config?: Partial<OpenCommerceConfig>
|
||||
preview?: boolean
|
||||
}): Promise<T['data']>
|
||||
|
||||
async function getPage<T extends GetPageOperation>(
|
||||
opts: {
|
||||
variables: T['variables']
|
||||
config?: Partial<OpenCommerceConfig>
|
||||
preview?: boolean
|
||||
} & OperationOptions
|
||||
): Promise<T['data']>
|
||||
|
||||
export default function getPageOperation() {
|
||||
function getPage(): Promise<GetPageResult> {
|
||||
return Promise.resolve({})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user