Skip to content

Commit

Permalink
Set 500 limit for listing categories in Categories section
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Sukhov committed Nov 6, 2023
1 parent b68a36d commit df7d27a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/composers/categories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ async function replyWithListOfCategories(ctx: MyContext) {
log('ctx: %O', ctx)
try {
const userSettings = ctx.session.userSettings
const categories = (await firefly(userSettings).Categories.listCategory()).data.data
// TODO: implement pagination of categories
const categories = (await firefly(userSettings).Categories.listCategory(undefined, 500)).data.data
const categoriesNames = categories.map((c: any) => c.attributes.name)
// log('categories: %O', categories)

Expand Down Expand Up @@ -275,7 +276,7 @@ export async function createCategoriesInlineKeyboard(ctx: MyContext): Promise<In
const log = rootLog.extend('createCategoriesInlineKeyboard')
try {
const userSettings = ctx.session.userSettings
const categories = (await firefly(userSettings).Categories.listCategory()).data.data
const categories = (await firefly(userSettings).Categories.listCategory(undefined, 500)).data.data
const keyboard = new InlineKeyboard()
const nowDate = dayjs().format('YYYY-MM-DD')

Expand Down
2 changes: 1 addition & 1 deletion src/composers/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function formatTransactionText(ctx: MyContext, tr: Partial<TransactionRead>) {
async function createCategoriesKeyboard(ctx: MyContext, mapper: Mapper) {
const log = debug.extend('createCategoriesKeyboard')
try {
const categories = (await firefly(ctx.session.userSettings).Categories.listCategory()).data.data
const categories = (await firefly(ctx.session.userSettings).Categories.listCategory(undefined, 500)).data.data
log('categories: %O', categories)

const keyboard = new InlineKeyboard()
Expand Down

0 comments on commit df7d27a

Please sign in to comment.