From 728574b401a56e99a5af69880232ffbff5a659fc Mon Sep 17 00:00:00 2001 From: Arno Erpenbeck <88486704+arnoerpenbeck@users.noreply.github.com> Date: Fri, 15 Nov 2024 11:47:34 +0100 Subject: [PATCH] fix: startAfterId for listings, return type for stocks (#76) --- src/fft-api/listing/fftListingService.ts | 3 ++- src/fft-api/stock/fftStockService.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fft-api/listing/fftListingService.ts b/src/fft-api/listing/fftListingService.ts index e88f332..215f6f4 100644 --- a/src/fft-api/listing/fftListingService.ts +++ b/src/fft-api/listing/fftListingService.ts @@ -31,10 +31,11 @@ export class FftListingService { } } - public async getAll(facilityId: string, size = 25): Promise { + public async getAll(facilityId: string, size = 25, startAfterId?: string): Promise { try { return await this.apiClient.get(`facilities/${facilityId}/${this.path}`, { ...(size && { size: size.toString() }), + ...(startAfterId && { startAfterId }), }); } catch (err) { console.error(`Could not get listings for facility ${facilityId}.`, err); diff --git a/src/fft-api/stock/fftStockService.ts b/src/fft-api/stock/fftStockService.ts index 81cca7f..24f0b76 100644 --- a/src/fft-api/stock/fftStockService.ts +++ b/src/fft-api/stock/fftStockService.ts @@ -66,9 +66,9 @@ export class FftStockService { } } - public async upsertStocks(stocksForUpsert: StocksForUpsert): Promise { + public async upsertStocks(stocksForUpsert: StocksForUpsert): Promise { try { - return await this.apiClient.put(this.path, { ...stocksForUpsert }); + return await this.apiClient.put(this.path, { ...stocksForUpsert }); } catch (error) { console.error(`Could not upsert stock.`, error); throw error;