feat(system): SID rules/lucky-numbers/assign, locales CRUD, devices list, robot session tokens
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { api } from '@/api/client'
|
||||
import type { ApiResponse, LocaleRow } from '@/api/types'
|
||||
|
||||
const BASE = '/api/admin/v1/locales'
|
||||
|
||||
export interface LocalePayload {
|
||||
code?: string
|
||||
name: string
|
||||
native_name: string
|
||||
is_active?: boolean
|
||||
sort_order?: number
|
||||
}
|
||||
|
||||
export function fetchLocales() {
|
||||
return api.get<ApiResponse<LocaleRow[]>>(BASE)
|
||||
}
|
||||
|
||||
export function createLocale(payload: LocalePayload) {
|
||||
return api.post<ApiResponse<LocaleRow>>(BASE, payload)
|
||||
}
|
||||
|
||||
export function updateLocale(code: string, payload: Partial<LocalePayload>) {
|
||||
return api.put<ApiResponse<LocaleRow>>(`${BASE}/${code}`, payload)
|
||||
}
|
||||
|
||||
export function deleteLocale(code: string) {
|
||||
return api.delete<ApiResponse<null>>(`${BASE}/${code}`)
|
||||
}
|
||||
Reference in New Issue
Block a user