Skip to content

Commit

Permalink
fix: startAfterId for listings, return type for stocks (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnoerpenbeck authored Nov 15, 2024
1 parent 031eba0 commit 728574b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/fft-api/listing/fftListingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ export class FftListingService {
}
}

public async getAll(facilityId: string, size = 25): Promise<StrippedListings> {
public async getAll(facilityId: string, size = 25, startAfterId?: string): Promise<StrippedListings> {
try {
return await this.apiClient.get<StrippedListings>(`facilities/${facilityId}/${this.path}`, {
...(size && { size: size.toString() }),
...(startAfterId && { startAfterId }),
});
} catch (err) {
console.error(`Could not get listings for facility ${facilityId}.`, err);
Expand Down
4 changes: 2 additions & 2 deletions src/fft-api/stock/fftStockService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ export class FftStockService {
}
}

public async upsertStocks(stocksForUpsert: StocksForUpsert): Promise<StockUpsertOperationResult> {
public async upsertStocks(stocksForUpsert: StocksForUpsert): Promise<StockUpsertOperationResult[]> {
try {
return await this.apiClient.put<StockUpsertOperationResult>(this.path, { ...stocksForUpsert });
return await this.apiClient.put<StockUpsertOperationResult[]>(this.path, { ...stocksForUpsert });
} catch (error) {
console.error(`Could not upsert stock.`, error);
throw error;
Expand Down

0 comments on commit 728574b

Please sign in to comment.