20 lines
759 B
TypeScript
20 lines
759 B
TypeScript
import type { TableInput } from '@core/type/baseTable'
|
|
import useAxios from '@core/utils/useAxios'
|
|
import type { Order } from '@/model/order'
|
|
import type { AddId, Customer } from '@/model/customer'
|
|
import type {Giftcard, GiftcardInput} from "@/model/giftCard";
|
|
|
|
export const getGiftCardTable = async (params: TableInput) =>
|
|
await useAxios.post<Array<Giftcard>>('/admin/giftcard/table', params)
|
|
|
|
export const createGiftCard = async (obj: GiftcardInput) =>
|
|
await useAxios.post<Giftcard>(`/admin/giftcard/generate`, obj)
|
|
|
|
export const updateGiftCard = async (id: number, obj: GiftcardInput) =>
|
|
await useAxios.put<Giftcard>(`/admin/giftcard/${id}`, obj)
|
|
|
|
export const deleteGiftCard = async (id: number) => await useAxios.delete(`/admin/giftcard/${id}`)
|
|
|
|
|
|
|