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 ({ export const loadArticleReactions = async ({
articleSlug, articleSlug,
page, limit = 100,
size offset = 0
}: { }: {
articleSlug: string articleSlug: string
page: number limit?: number
size: number offset?: number
}): Promise<void> => { }): Promise<void> => {
const resp = await apiClient.getArticleReactions({ articleSlug, page, size }) const resp = await apiClient.getArticleReactions({ articleSlug, limit, offset })
reactionsOrdered.set(resp) reactionsOrdered.set(resp)
} }
export const loadReactions = async ({ export const loadReactions = async ({
shoutSlugs, shoutSlugs,
page, limit = 100,
size offset = 0
}: { }: {
shoutSlugs: string[] shoutSlugs: string[]
page: number limit: number
size: number offset: number
}): Promise<void> => { }): Promise<void> => {
const reactions = await apiClient.getReactionsForShouts({ shoutSlugs, page, size }) const reactions = await apiClient.getReactionsForShouts({ shoutSlugs, limit, offset })
reactionsOrdered.set(reactions) reactionsOrdered.set(reactions)
} }