Skip to content

Commit

Permalink
fix: getWatcherHistoricalPrices method response |5
Browse files Browse the repository at this point in the history
  • Loading branch information
serezhaolshan committed Oct 4, 2024
1 parent 20a2a9f commit 822ac1f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/watcher/watcher.network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export class WatcherNetwork {
async getWatcherHistoricalPrices(req: Request, res: Response): Promise<void> {
try {
const prices = await this.service.getWatcherHistoryPrices();
res.json({ prices: JSON.parse(prices) });
if (!prices || prices.length === 0) res.json({ prices: [] });
else res.json({ prices: JSON.parse(prices) });
} catch (error) {
this.handleErrorResponse(res, error);
}
Expand Down

0 comments on commit 822ac1f

Please sign in to comment.