mirror of
https://github.com/Myzel394/kleckrelay-website.git
synced 2025-06-18 23:45:26 +02:00
fix: Adapt API to upstream
This commit is contained in:
parent
0263b51cf8
commit
c5bedec8e9
@ -1,7 +1,14 @@
|
||||
import {client} from "~/constants/axios-client"
|
||||
import {AdminSettings} from "~/server-types"
|
||||
|
||||
export default async function getAdminSettings(): Promise<Partial<AdminSettings>> {
|
||||
export type GetAdminSettingsResponse =
|
||||
| Partial<AdminSettings>
|
||||
| {
|
||||
detail: string
|
||||
code: "error:settings:global_settings_disabled"
|
||||
}
|
||||
|
||||
export default async function getAdminSettings(): Promise<GetAdminSettingsResponse> {
|
||||
const {data} = await client.get(`${import.meta.env.VITE_SERVER_BASE_URL}/v1/admin/settings`, {
|
||||
withCredentials: true,
|
||||
})
|
||||
|
@ -1,6 +1,13 @@
|
||||
import {ServerSettings} from "~/server-types"
|
||||
import {client} from "~/constants/axios-client"
|
||||
|
||||
export default async function getServerSettings(): Promise<ServerSettings> {
|
||||
export type GetServerSettingsResponse =
|
||||
| ServerSettings
|
||||
| {
|
||||
detail: string
|
||||
code: "error:settings:statistics_disabled"
|
||||
}
|
||||
|
||||
export default async function getServerSettings(): Promise<GetServerSettingsResponse> {
|
||||
return (await client.get(`${import.meta.env.VITE_SERVER_BASE_URL}/v1/server/settings`)).data
|
||||
}
|
||||
|
@ -6,6 +6,13 @@ export interface ResendEmailLoginCodeData {
|
||||
sameRequestToken: string
|
||||
}
|
||||
|
||||
export type ResendEmailLoginCodeResponse =
|
||||
| SimpleDetailResponse
|
||||
| {
|
||||
detail: string
|
||||
code: "ok:email_already_verified"
|
||||
}
|
||||
|
||||
export default async function resendEmailLoginCode({
|
||||
email,
|
||||
sameRequestToken,
|
||||
|
@ -1,6 +1,13 @@
|
||||
import {client} from "~/constants/axios-client"
|
||||
import {AdminSettings} from "~/server-types"
|
||||
|
||||
export type UpdateAdminSettingsResponse =
|
||||
| Partial<AdminSettings>
|
||||
| {
|
||||
detail: string
|
||||
code: "error:settings:global_settings_disabled"
|
||||
}
|
||||
|
||||
export default async function updateAdminSettings(
|
||||
settings: Partial<AdminSettings>,
|
||||
): Promise<AdminSettings> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user