mirror of
https://github.com/dromara/hertzbeat.git
synced 2026-10-05 16:09:03 +00:00
14 lines
470 B
TypeScript
14 lines
470 B
TypeScript
import type { ObjectStoreConfig } from '@/lib/types';
|
|
|
|
type ApiGetter = <T>(url: string) => Promise<T>;
|
|
type ApiPoster = <T>(url: string, payload: unknown) => Promise<T>;
|
|
|
|
export async function loadObjectStoreConfig(apiGet: ApiGetter) {
|
|
const config = await apiGet<ObjectStoreConfig>('/config/oss');
|
|
return { config };
|
|
}
|
|
|
|
export async function saveObjectStoreConfig(apiPost: ApiPoster, config: ObjectStoreConfig) {
|
|
return apiPost<string>('/config/oss', config);
|
|
}
|