Use new schema arg

environments/review-group-comp-s3yeyp/deployments/2859
Chewbacca 2023-03-14 10:11:20 -04:00
rodzic 7be8218f0c
commit f4d2f42c01
2 zmienionych plików z 2 dodań i 16 usunięć

Wyświetl plik

@ -12,7 +12,7 @@ function usePopularGroups() {
[Entities.POPULAR_GROUPS, ''], [Entities.POPULAR_GROUPS, ''],
'/api/mock/groups', // '/api/v1/truth/trends/groups' '/api/mock/groups', // '/api/v1/truth/trends/groups'
{ {
parser: parseGroup, schema: groupSchema,
enabled: features.groupsDiscovery, 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 }; export { usePopularGroups };

Wyświetl plik

@ -12,7 +12,7 @@ function useSuggestedGroups() {
[Entities.POPULAR_GROUPS, ''], [Entities.POPULAR_GROUPS, ''],
'/api/mock/groups', // '/api/v1/truth/suggestions/groups' '/api/mock/groups', // '/api/v1/truth/suggestions/groups'
{ {
parser: parseGroup, schema: groupSchema,
enabled: features.groupsDiscovery, 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 }; export { useSuggestedGroups };