-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #322 from psteinroe/fix/has-more
fix: set hasMore to false if list is currently empty
- Loading branch information
Showing
4 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@supabase-cache-helpers/postgrest-core": patch | ||
--- | ||
|
||
fix: set hasMore to false if result is currently empty |
16 changes: 16 additions & 0 deletions
16
packages/postgrest-core/__tests__/mutate/transformers.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { toHasMorePaginationCacheData } from '../../src/mutate/transformers'; | ||
|
||
describe('toHasMorePaginationCacheData', () => { | ||
it('should set hasMore to false if there are no items in the cache currently', async () => { | ||
expect(toHasMorePaginationCacheData([{ test: 'a' }], [], 21)).toEqual([ | ||
{ | ||
data: [ | ||
{ | ||
test: 'a', | ||
}, | ||
], | ||
hasMore: false, | ||
}, | ||
]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eb1ad24
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
supabase-cache-helpers-react-query – ./examples/react-query
supabase-cache-helpers-react-query-psteinroe.vercel.app
supabase-cache-helpers-react-query.vercel.app
supabase-cache-helpers-react-query-git-main-psteinroe.vercel.app
eb1ad24
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
supabase-cache-helpers-swr-demo – ./examples/swr
supabase-cache-helpers-swr.vercel.app
supabase-cache-helpers-swr-demo-git-main-psteinroe.vercel.app
supabase-cache-helpers-swr-demo-psteinroe.vercel.app