mirror of
https://github.com/Myzel394/kleckrelay-website.git
synced 2025-06-20 00:05:26 +02:00
26 lines
490 B
TypeScript
26 lines
490 B
TypeScript
import {ReservedAlias} from "~/server-types"
|
|
import {client} from "~/constants/axios-client"
|
|
|
|
export interface CreateReservedAliasData {
|
|
local: string
|
|
users: Array<{
|
|
id: string
|
|
}>
|
|
|
|
isActive?: boolean
|
|
}
|
|
|
|
export default async function createReservedAlias(
|
|
aliasData: CreateReservedAliasData,
|
|
): Promise<ReservedAlias> {
|
|
const {data} = await client.post(
|
|
`${import.meta.env.VITE_SERVER_BASE_URL}/v1/reserved-alias`,
|
|
aliasData,
|
|
{
|
|
withCredentials: true,
|
|
},
|
|
)
|
|
|
|
return data
|
|
}
|