mirror of
https://github.com/vercel/commerce.git
synced 2025-07-27 04:01:23 +00:00
Add Spree as allowed Framework
This commit is contained in:
37
framework/spree/api/operations/get-all-pages.ts
Normal file
37
framework/spree/api/operations/get-all-pages.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
export type Page = { url: string }
|
||||
import { OperationContext, OperationOptions } from '@commerce/api/operations'
|
||||
import { GetAllPagesOperation } from '@commerce/types/page'
|
||||
import type { SpreeApiConfig, SpreeApiProvider } from '../index'
|
||||
|
||||
export default function getAllPagesOperation({
|
||||
commerce,
|
||||
}: OperationContext<SpreeApiProvider>) {
|
||||
async function getAllPages<T extends GetAllPagesOperation>(options?: {
|
||||
config?: Partial<SpreeApiConfig>
|
||||
preview?: boolean
|
||||
}): Promise<T['data']>
|
||||
|
||||
async function getAllPages<T extends GetAllPagesOperation>(
|
||||
opts: {
|
||||
config?: Partial<SpreeApiConfig>
|
||||
preview?: boolean
|
||||
} & OperationOptions
|
||||
): Promise<T['data']>
|
||||
|
||||
async function getAllPages<T extends GetAllPagesOperation>({
|
||||
config,
|
||||
preview,
|
||||
query,
|
||||
}: {
|
||||
url?: string
|
||||
config?: Partial<SpreeApiConfig>
|
||||
preview?: boolean
|
||||
query?: string
|
||||
} = {}): Promise<T['data']> {
|
||||
return {
|
||||
pages: [],
|
||||
}
|
||||
}
|
||||
|
||||
return getAllPages
|
||||
}
|
Reference in New Issue
Block a user