Keep api/client.ts and trips.service.ts within their size baselines

The admin switch for wanderer moves to api/wanderer.ts and the recorded
track restore to api/recordedTrack.ts; trips.service.ts keeps dev's
formatting with only the derived-from remap on copy.
This commit is contained in:
Maurice
2026-10-15 18:16:25 +02:00
parent f690065de8
commit f1c437b8b8
8 changed files with 124 additions and 254 deletions
@@ -1,6 +1,7 @@
import { useEffect, useEffectEvent, useState } from 'react';
import { adminApi } from '../../../api/client';
import { wandererAdminApi } from '../../../api/wanderer';
import { useTranslation } from '../../../i18n';
import { useAddonStore } from '../../../store/addonStore';
import { useToast } from '../../shared/Toast';
@@ -31,8 +32,8 @@ export function useAddonManager() {
const loadOnMount = useEffectEvent(() => {
void loadAddons().finally(() => setLoading(false));
adminApi
.getToursWanderer()
wandererAdminApi
.get()
.then((flag) => setToursWanderer(flag.enabled))
.catch(() => toast.error(t('admin.addons.toast.error')));
});
@@ -67,7 +68,7 @@ export function useAddonManager() {
const next = !toursWanderer;
setToursWanderer(next);
try {
await adminApi.updateToursWanderer(next);
await wandererAdminApi.update(next);
} catch {
setToursWanderer(!next);
toast.error(t('admin.addons.toast.error'));