26 lines
732 B
TypeScript
26 lines
732 B
TypeScript
import { adminApi } from '@/api/client'
|
|
import type { IdType, PageResult } from '@/types/common'
|
|
import type { Product } from '@/types/manager'
|
|
|
|
export interface ProductCreateRequest {
|
|
title: string
|
|
description?: string
|
|
targetAudience?: string
|
|
precautions?: string
|
|
imageFileIds?: string
|
|
price: number
|
|
tags?: string
|
|
approximateDuration?: string
|
|
bookableArtists?: string
|
|
frontVisible: number
|
|
}
|
|
|
|
export const managerProductsApi = {
|
|
list(params: { page: number; size: number; keyword?: string }): Promise<PageResult<Product> | Product[]> {
|
|
return adminApi.get('/manager/products', { params })
|
|
},
|
|
create(data: ProductCreateRequest): Promise<IdType> {
|
|
return adminApi.post('/product/create', data)
|
|
}
|
|
}
|