Skip to content

Commit

Permalink
Merge pull request #57 from ambrosus/rewrite
Browse files Browse the repository at this point in the history
Fix historical price response
  • Loading branch information
serezhaolshan authored Oct 8, 2024
2 parents 9ad94cd + 822ac1f commit f60d3d9
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);
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 f60d3d9

Please sign in to comment.