mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-03 07:06:36 +08:00
[功能] 添加批量更新选项接口,支持一次性更新多个配置项,更新相关逻辑和测试
This commit is contained in:
@@ -25,7 +25,7 @@ import {
|
||||
getSettingsProfile,
|
||||
lookupGeoIP,
|
||||
rotateBootstrapToken,
|
||||
updateOption,
|
||||
updateOptions,
|
||||
updateSelf,
|
||||
} from '@/features/settings/api/settings';
|
||||
import type {
|
||||
@@ -558,9 +558,7 @@ export function SettingsPage() {
|
||||
entries: Array<[string, string]>,
|
||||
successMessage: string,
|
||||
) => {
|
||||
for (const [key, value] of entries) {
|
||||
await updateOption(key, value);
|
||||
}
|
||||
await updateOptions(entries.map(([key, value]) => ({ key, value })));
|
||||
|
||||
await queryClient.invalidateQueries({ queryKey: settingsQueryKey });
|
||||
await queryClient.invalidateQueries({ queryKey: ['public-status'] });
|
||||
|
||||
Reference in New Issue
Block a user