diff --git a/app/soapbox/hooks/api/usePopularGroups.ts b/app/soapbox/hooks/api/usePopularGroups.ts index b4b74c7f4..e856270a5 100644 --- a/app/soapbox/hooks/api/usePopularGroups.ts +++ b/app/soapbox/hooks/api/usePopularGroups.ts @@ -12,7 +12,7 @@ function usePopularGroups() { [Entities.POPULAR_GROUPS, ''], '/api/mock/groups', // '/api/v1/truth/trends/groups' { - parser: parseGroup, + schema: groupSchema, enabled: features.groupsDiscovery, }, ); @@ -30,11 +30,4 @@ function usePopularGroups() { }; } -const parseGroup = (entity: unknown) => { - const result = groupSchema.safeParse(entity); - if (result.success) { - return result.data; - } -}; - export { usePopularGroups }; \ No newline at end of file diff --git a/app/soapbox/hooks/api/useSuggestedGroups.ts b/app/soapbox/hooks/api/useSuggestedGroups.ts index 1022a45b0..829108469 100644 --- a/app/soapbox/hooks/api/useSuggestedGroups.ts +++ b/app/soapbox/hooks/api/useSuggestedGroups.ts @@ -12,7 +12,7 @@ function useSuggestedGroups() { [Entities.POPULAR_GROUPS, ''], '/api/mock/groups', // '/api/v1/truth/suggestions/groups' { - parser: parseGroup, + schema: groupSchema, enabled: features.groupsDiscovery, }, ); @@ -30,11 +30,4 @@ function useSuggestedGroups() { }; } -const parseGroup = (entity: unknown) => { - const result = groupSchema.safeParse(entity); - if (result.success) { - return result.data; - } -}; - export { useSuggestedGroups }; \ No newline at end of file