mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
feat(admin)!: move the admin api to rest and fix its defects (#2515)
This commit is contained in:
1 parent
a70924d4b0
commit
7f8f09ee51
143 files changed
+15238
-12790
No files matched your search
@@ -13,12 +13,12 @@ import type {
|
||||
export type SetupBrandingAssetKind = BrandingAssetUploadRequest['kind'];
|
||||
|
||||
export async function fetchInstanceConfig(): Promise<InstanceConfigResponse> {
|
||||
const response = await http.post<InstanceConfigResponse>(Endpoints.ADMIN_INSTANCE_CONFIG_GET);
|
||||
const response = await http.get<InstanceConfigResponse>(Endpoints.ADMIN_INSTANCE_CONFIG);
|
||||
return response.body;
|
||||
}
|
||||
|
||||
export async function updateInstanceConfig(body: InstanceConfigUpdateRequest): Promise<InstanceConfigResponse> {
|
||||
const response = await http.post<InstanceConfigResponse>(Endpoints.ADMIN_INSTANCE_CONFIG_UPDATE, {body});
|
||||
const response = await http.patch<InstanceConfigResponse>(Endpoints.ADMIN_INSTANCE_CONFIG, {body});
|
||||
return response.body;
|
||||
}
|
||||
|
||||
@@ -27,11 +27,11 @@ export async function uploadBrandingAsset(
|
||||
image: string | null,
|
||||
): Promise<InstanceConfigResponse> {
|
||||
const body: BrandingAssetUploadRequest = {kind, image};
|
||||
const response = await http.post<InstanceConfigResponse>(Endpoints.ADMIN_INSTANCE_CONFIG_BRANDING_ASSET, {body});
|
||||
const response = await http.post<InstanceConfigResponse>(Endpoints.ADMIN_INSTANCE_CONFIG_BRANDING_ASSETS, {body});
|
||||
return response.body;
|
||||
}
|
||||
|
||||
export async function testSmtpConfig(body: InstanceEmailSmtpTestRequest): Promise<InstanceEmailSmtpTestResponse> {
|
||||
const response = await http.post<InstanceEmailSmtpTestResponse>(Endpoints.ADMIN_INSTANCE_CONFIG_SMTP_TEST, {body});
|
||||
const response = await http.post<InstanceEmailSmtpTestResponse>(Endpoints.ADMIN_INSTANCE_CONFIG_SMTP_TESTS, {body});
|
||||
return response.body;
|
||||
}
|
||||
@@ -34,10 +34,9 @@ export const Endpoints = {
|
||||
},
|
||||
AUTH_SSO_START: '/auth/sso/start',
|
||||
AUTH_SSO_COMPLETE: '/auth/sso/complete',
|
||||
ADMIN_INSTANCE_CONFIG_GET: '/admin/instance-config/get',
|
||||
ADMIN_INSTANCE_CONFIG_UPDATE: '/admin/instance-config/update',
|
||||
ADMIN_INSTANCE_CONFIG_BRANDING_ASSET: '/admin/instance-config/branding-asset',
|
||||
ADMIN_INSTANCE_CONFIG_SMTP_TEST: '/admin/instance-config/integrations/smtp/test',
|
||||
ADMIN_INSTANCE_CONFIG: '/admin/instance/config',
|
||||
ADMIN_INSTANCE_CONFIG_BRANDING_ASSETS: '/admin/instance/config/branding-assets',
|
||||
ADMIN_INSTANCE_CONFIG_SMTP_TESTS: '/admin/instance/config/smtp-tests',
|
||||
SUDO_WEBAUTHN_OPTIONS: '/users/@me/sudo/webauthn/authentication-options',
|
||||
OAUTH_AUTHORIZE: '/oauth2/authorize',
|
||||
OAUTH_CONSENT: '/oauth2/authorize/consent',
|
||||
|
||||
Reference in new issue
Block a user