From cb3748a7318f7ae3d4e9dc0b67b78eb8eb914c9f Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Wed, 14 Sep 2022 14:20:31 +0300 Subject: [PATCH] offset-limit-fix-2 --- src/stores/zine/reactions.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/stores/zine/reactions.ts b/src/stores/zine/reactions.ts index 0b5a54fa..daadb149 100644 --- a/src/stores/zine/reactions.ts +++ b/src/stores/zine/reactions.ts @@ -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 => { - 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 => { - const reactions = await apiClient.getReactionsForShouts({ shoutSlugs, page, size }) + const reactions = await apiClient.getReactionsForShouts({ shoutSlugs, limit, offset }) reactionsOrdered.set(reactions) }