mirror of
https://github.com/strapi/strapi.git
synced 2025-08-06 07:50:02 +00:00
useRelation: Update tests
This commit is contained in:
parent
29e2e43132
commit
0fb9a7f525
@ -35,6 +35,7 @@ function setup(name = 'test', args) {
|
||||
() =>
|
||||
useRelation(name, {
|
||||
relation: {
|
||||
enabled: true,
|
||||
endpoint: '/',
|
||||
pageParams: {
|
||||
limit: 10,
|
||||
|
@ -38,7 +38,7 @@ export const useRelation = (cacheKey, { relation, search }) => {
|
||||
};
|
||||
|
||||
const relationsRes = useInfiniteQuery(['relation', cacheKey], fetchRelations, {
|
||||
enabled: !!relation?.enabled ?? true,
|
||||
enabled: relation.enabled,
|
||||
getNextPageParam(lastPage) {
|
||||
// the API may send an empty 204 response
|
||||
if (!lastPage || lastPage.pagination.page >= lastPage.pagination.pageCount) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user