返回 AiToEarn
pinterest.api.ts
根目录 / project / aitoearn-web / src / api / platforms / pinterest.api.ts
1 import type { PinterestBoardCreateParams } from './pinterest.types'
2 import type { PublishOptionCreatedValueVo, PublishOptionValuesVo } from '@/api/channels/channel.types'
3 import http from '@/utils/request'
4 import { PINTEREST_BOARD_FIELD } from './pinterest.constants'
5
6 // Source: pinterest.ts
7 function getPinterestBoardOptionValuesUrl(accountId: string) {
8 return `v2/channels/accounts/${encodeURIComponent(accountId)}/publish-options/${PINTEREST_BOARD_FIELD}/values`
9 }
10
11 /**
12 * 创建board
13 */
14 export function createPinterestBoardApi(data: PinterestBoardCreateParams, accountId: string) {
15 return http.post<PublishOptionCreatedValueVo>(getPinterestBoardOptionValuesUrl(accountId), data)
16 }
17
18 /**
19 * 获取board列表信息
20 */
21 export function getPinterestBoardListApi(accountId: string) {
22 return http.get<PublishOptionValuesVo>(getPinterestBoardOptionValuesUrl(accountId))
23 }
24
24 lines TYPESCRIPT