import type { ApiResponse } from "@/lib/api"
import { callPublic } from "./base"

export type SMSPurpose = "User_Code" | "FindUser_Code" | "User_Login"

export async function sendSMS(
  phone: string,
  purpose: SMSPurpose = "User_Code",
): Promise<ApiResponse<undefined>> {
  return await callPublic("/user/SendPhonesCodevefy", {
    key: purpose,
    phone,
  })
}
