Shun Miyazawa 3 лет назад
Родитель
Сommit
d92e1b9ed6
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      packages/app/src/stores/activity.ts

+ 7 - 0
packages/app/src/stores/activity.ts

@@ -19,3 +19,10 @@ export const useSWRxActivityList = (limit?: number, offset?: number, searchFilte
       .then(result => result.data.paginationResult),
   );
 };
+
+export const useSWRxUsernameList = (q: string): SWRResponse<string[], Error> => {
+  return useSWRImmutable(
+    ['/activity/usernames', q],
+    (endpoint, q) => apiv3Get(endpoint, { q }).then(result => result.data.usernames),
+  );
+};