Files
ghatreh_admin/src/api/sms.ts
T
2025-10-05 11:29:51 +03:30

26 lines
1.0 KiB
TypeScript

import type { AddId, Customer } from '@/model/customer'
import useAxios from '@core/utils/useAxios'
import type { last, Price } from '@/model/price'
import type { TableInput } from '@core/type/baseTable'
import type { Order } from '@/model/order'
import type { FunctionItem } from '@/model/Item'
import sms from '@/router/routes/sms'
import type { Sms } from '@/model/sms'
export const getSMSTable = async (params: TableInput) =>
await useAxios.post<Array<Price>>('/admin/messages/table', params)
export const getNumbersTable = async (params: TableInput) =>
await useAxios.post<Array<Price>>('/admin/messages/get_customer_list/table', params)
export const getGroupsList = async () =>
await useAxios.get<FunctionItem[]>(`/admin/messages/functions`)
export const getCustomerList = async (obj: string[]) =>
await useAxios.post<{ customers: Customer[] }>(`/admin/messages/get_customer_list`, {
functions: obj
})
export const createSMS = async (obj: Sms) =>
await useAxios.post<AddId>(`/admin/messages/send_message`, obj)