mirror of
https://github.com/ConvoyPanel/panel.git
synced 2026-06-15 18:18:22 +08:00
16 lines
397 B
TypeScript
16 lines
397 B
TypeScript
import { Location, rawDataToLocation } from '@/api/admin/locations/getLocations'
|
|
import http from '@/api/http'
|
|
|
|
export default async (
|
|
shortCode: string,
|
|
description: string | null
|
|
): Promise<Location> => {
|
|
const {
|
|
data: { data },
|
|
} = await http.post('/api/admin/locations', {
|
|
short_code: shortCode,
|
|
description,
|
|
})
|
|
|
|
return rawDataToLocation(data)
|
|
} |