mirror of
https://github.com/Myzel394/kleckrelay-website.git
synced 2025-06-19 07:55:25 +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 {client} from "~/constants/axios-client"
|
||||||
import {AdminSettings} from "~/server-types"
|
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`, {
|
const {data} = await client.get(`${import.meta.env.VITE_SERVER_BASE_URL}/v1/admin/settings`, {
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
})
|
})
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
import {ServerSettings} from "~/server-types"
|
import {ServerSettings} from "~/server-types"
|
||||||
import {client} from "~/constants/axios-client"
|
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
|
return (await client.get(`${import.meta.env.VITE_SERVER_BASE_URL}/v1/server/settings`)).data
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,13 @@ export interface ResendEmailLoginCodeData {
|
|||||||
sameRequestToken: string
|
sameRequestToken: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type ResendEmailLoginCodeResponse =
|
||||||
|
| SimpleDetailResponse
|
||||||
|
| {
|
||||||
|
detail: string
|
||||||
|
code: "ok:email_already_verified"
|
||||||
|
}
|
||||||
|
|
||||||
export default async function resendEmailLoginCode({
|
export default async function resendEmailLoginCode({
|
||||||
email,
|
email,
|
||||||
sameRequestToken,
|
sameRequestToken,
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
import {client} from "~/constants/axios-client"
|
import {client} from "~/constants/axios-client"
|
||||||
import {AdminSettings} from "~/server-types"
|
import {AdminSettings} from "~/server-types"
|
||||||
|
|
||||||
|
export type UpdateAdminSettingsResponse =
|
||||||
|
| Partial<AdminSettings>
|
||||||
|
| {
|
||||||
|
detail: string
|
||||||
|
code: "error:settings:global_settings_disabled"
|
||||||
|
}
|
||||||
|
|
||||||
export default async function updateAdminSettings(
|
export default async function updateAdminSettings(
|
||||||
settings: Partial<AdminSettings>,
|
settings: Partial<AdminSettings>,
|
||||||
): Promise<AdminSettings> {
|
): Promise<AdminSettings> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user