Replies: 2 comments 7 replies
-
Please explain why, @pepegc |
Beta Was this translation helpful? Give feedback.
7 replies
-
const { foo, bar, ...whatPrismaDoesNotExpect } = input;
const makePagination = ({page, total, ...rest}: {
page: number;
total: number;
[X: string]: unknown;
}) => ({
nextPageUrl: new URLSearchParams({ page: Math.min(page + 1, total), ...rest }).toString(),
prevPageUrl: new URLSearchParams({ page: Math.max(page - 1, 1), ...rest }).toString(),
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I find myself in need of distinguishing
input
in my handlers. Right now everything gets flattened there.Ideally
input
would have aquery
with the query params,params
with the url params,headers
, etc...Alternatively, drop the input altogether and put these new things on the top level:
My current workaround:
Beta Was this translation helpful? Give feedback.
All reactions