Просмотр исходного кода

Update activity hook to return populated activities

arvid-e 4 месяцев назад
Родитель
Сommit
0fbec50a80
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      apps/app/src/stores/recent-activity.ts

+ 4 - 4
apps/app/src/stores/recent-activity.ts

@@ -3,8 +3,8 @@ import useSWRImmutable from 'swr/immutable';
 
 import { apiv3Get } from '~/client/util/apiv3-client';
 import type {
-  IActivityHasId,
-  UserActivitiesResult,
+  ActivityHasTargetPage,
+  PopulatedUserActivitiesResult,
 } from '~/interfaces/activity';
 import type { PaginateResult } from '~/interfaces/mongoose-utils';
 
@@ -12,14 +12,14 @@ export const useSWRxRecentActivity = (
   limit?: number,
   offset?: number,
   targetUserId?: string,
-): SWRResponse<PaginateResult<IActivityHasId>, Error> => {
+): SWRResponse<PaginateResult<ActivityHasTargetPage>, Error> => {
   const shouldFetch = targetUserId && targetUserId.length > 0;
   const key = shouldFetch
     ? ['/user-activities', limit, offset, targetUserId]
     : null;
 
   const fetcher = ([endpoint, limitParam, offsetParam, targetUserIdParam]) => {
-    const promise = apiv3Get<UserActivitiesResult>(endpoint, {
+    const promise = apiv3Get<PopulatedUserActivitiesResult>(endpoint, {
       limit: limitParam,
       offset: offsetParam,
       targetUserId: targetUserIdParam,