Skip to content

Commit

Permalink
Return empty response instead of error (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
surbhit14 authored Dec 19, 2024
1 parent 14e97ff commit 95d7474
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/api/src/routes/avs/avsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,12 +528,6 @@ export async function getAVSRewards(req: Request, res: Response) {
}
})

if (!rewardsSubmissions || rewardsSubmissions.length === 0) {
throw new Error('AVS not found.')
}

const tokenPrices = await fetchTokenPrices()

const result: {
address: string
submissions: Submission[]
Expand All @@ -550,6 +544,11 @@ export async function getAVSRewards(req: Request, res: Response) {
rewardStrategies: []
}

if (!rewardsSubmissions || rewardsSubmissions.length === 0) {
return res.send(result)
}

const tokenPrices = await fetchTokenPrices()
const rewardTokens: string[] = []
const rewardStrategies: string[] = []
let currentSubmission: Submission | null = null
Expand Down

0 comments on commit 95d7474

Please sign in to comment.