offset-limit-fix-2

This commit is contained in:
tonyrewin 2022-09-14 14:20:31 +03:00
parent 00a0f9886c
commit cb3748a731

View File

@ -19,27 +19,27 @@ export const useReactionsStore = (initial?: Reaction[]) => {
export const loadArticleReactions = async ({
articleSlug,
page,
size
limit = 100,
offset = 0
}: {
articleSlug: string
page: number
size: number
limit?: number
offset?: number
}): Promise<void> => {
const resp = await apiClient.getArticleReactions({ articleSlug, page, size })
const resp = await apiClient.getArticleReactions({ articleSlug, limit, offset })
reactionsOrdered.set(resp)
}
export const loadReactions = async ({
shoutSlugs,
page,
size
limit = 100,
offset = 0
}: {
shoutSlugs: string[]
page: number
size: number
limit: number
offset: number
}): Promise<void> => {
const reactions = await apiClient.getReactionsForShouts({ shoutSlugs, page, size })
const reactions = await apiClient.getReactionsForShouts({ shoutSlugs, limit, offset })
reactionsOrdered.set(reactions)
}