|
|
@@ -2,16 +2,9 @@ import { SWRResponse } from 'swr';
|
|
|
import useSWRImmutable from 'swr/immutable';
|
|
|
|
|
|
import { apiv3Get } from '../client/util/apiv3-client';
|
|
|
-import { IActivityHasId, SupportedActionType } from '../interfaces/activity';
|
|
|
+import { IActivityHasId, ISearchFilter } from '../interfaces/activity';
|
|
|
import { PaginateResult } from '../interfaces/mongoose-utils';
|
|
|
|
|
|
-
|
|
|
-type ISearchFilter = {
|
|
|
- usernames?: string[]
|
|
|
- dates?: {startDate: string | null, endDate: string | null}
|
|
|
- actions?: SupportedActionType[]
|
|
|
-}
|
|
|
-
|
|
|
export const useSWRxActivity = (limit?: number, offset?: number, searchFilter?: ISearchFilter): SWRResponse<PaginateResult<IActivityHasId>, Error> => {
|
|
|
const stringifiedSearchFilter = JSON.stringify(searchFilter);
|
|
|
return useSWRImmutable(
|