Taichi Masuyama 3 лет назад
Родитель
Сommit
f84dd08210
1 измененных файлов с 13 добавлено и 0 удалено
  1. 13 0
      packages/app/src/stores/admin/app-settings.tsx

+ 13 - 0
packages/app/src/stores/admin/app-settings.tsx

@@ -0,0 +1,13 @@
+import useSWR, { SWRResponse } from 'swr';
+
+import { apiv3Get } from '~/client/util/apiv3-client';
+import { IResAppSettings } from '~/interfaces/res/admin/app-settings';
+
+export const useSWRxAppSettings = (): SWRResponse<IResAppSettings, Error> => {
+  return useSWR(
+    '/app-settings/',
+    endpoint => apiv3Get(endpoint).then((response) => {
+      return response.data.appSettingsParams;
+    }),
+  );
+};