Skip to content

Commit cf28f04

Browse files
enzo-bitflyremoterami
authored andcommitted
feat: apply search filter to withdrawals and deposits total queries
See: BEDS-1489
1 parent 6c52c8d commit cf28f04

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

frontend/composables/useDashboardData.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,16 @@ export const useDashboardData = () => {
3030

3131
return res
3232
}
33-
async function fetchELDpositsTotalAmount(dashboardKey: DashboardKey) {
33+
async function fetchELDpositsTotalAmount(
34+
dashboardKey: DashboardKey,
35+
query?: Pick<TableQueryParams, 'search'>,
36+
) {
3437
const res
3538
= await fetch<GetValidatorDashboardTotalExecutionDepositsResponse>(
3639
'DASHBOARD_EL_DEPOSITS_TOTAL',
3740
undefined,
3841
{ dashboardKey },
42+
query,
3943
)
4044

4145
return res
@@ -56,12 +60,16 @@ export const useDashboardData = () => {
5660
return res
5761
}
5862

59-
async function fetchClDpositsTotalAmount(dashboardKey: DashboardKey) {
63+
async function fetchClDpositsTotalAmount(
64+
dashboardKey: DashboardKey,
65+
query?: Pick<TableQueryParams, 'search'>,
66+
) {
6067
const res
6168
= await fetch<GetValidatorDashboardTotalConsensusDepositsResponse>(
6269
'DASHBOARD_CL_DEPOSITS_TOTAL',
6370
undefined,
6471
{ dashboardKey },
72+
query,
6573
)
6674

6775
return res
@@ -112,12 +120,14 @@ export const useDashboardData = () => {
112120

113121
async function fetchElWithdrawalsTotalAmount(
114122
dashboardKey: DashboardKey,
123+
query?: Pick<TableQueryParams, 'search'>,
115124
) {
116125
const res
117126
= await fetch<GetValidatorDashboardTotalExecutionWithdrawalsResponse>(
118127
'DASHBOARD_EL_WITHDRAWALS_TOTAL',
119128
undefined,
120129
{ dashboardKey },
130+
query,
121131
)
122132

123133
return res
@@ -140,12 +150,14 @@ export const useDashboardData = () => {
140150

141151
async function fetchClWithdrawalsTotalAmount(
142152
dashboardKey: DashboardKey,
153+
query?: Pick<TableQueryParams, 'search'>,
143154
) {
144155
const res
145156
= await fetch<GetValidatorDashboardTotalConsensusWithdrawalsResponse>(
146157
'DASHBOARD_CL_WITHDRAWALS_TOTAL',
147158
undefined,
148159
{ dashboardKey },
160+
query,
149161
)
150162

151163
return res

frontend/pages/dashboard/[[id]]/index.vue

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,10 @@ const {
206206
dashboardKey.value,
207207
elDepositsQueryParams.value,
208208
),
209-
dashboardData.fetchELDpositsTotalAmount(dashboardKey.value),
209+
dashboardData.fetchELDpositsTotalAmount(
210+
dashboardKey.value,
211+
{ search: elDepositsQueryParams.value.search },
212+
),
210213
])
211214
},
212215
{
@@ -233,7 +236,10 @@ const {
233236
dashboardKey.value,
234237
clDepositsQueryParams.value,
235238
),
236-
dashboardData.fetchClDpositsTotalAmount(dashboardKey.value),
239+
dashboardData.fetchClDpositsTotalAmount(
240+
dashboardKey.value,
241+
{ search: clDepositsQueryParams.value.search },
242+
),
237243
])
238244
},
239245
{
@@ -260,7 +266,10 @@ const {
260266
dashboardKey.value,
261267
elWithdrawalsQueryParams.value,
262268
),
263-
dashboardData.fetchElWithdrawalsTotalAmount(dashboardKey.value),
269+
dashboardData.fetchElWithdrawalsTotalAmount(
270+
dashboardKey.value,
271+
{ search: elWithdrawalsQueryParams.value.search },
272+
),
264273
])
265274
},
266275
{
@@ -287,7 +296,10 @@ const {
287296
dashboardKey.value,
288297
clWithdrawalsQueryParams.value,
289298
),
290-
dashboardData.fetchClWithdrawalsTotalAmount(dashboardKey.value),
299+
dashboardData.fetchClWithdrawalsTotalAmount(
300+
dashboardKey.value,
301+
{ search: clWithdrawalsQueryParams.value.search },
302+
),
291303
])
292304
},
293305
{

0 commit comments

Comments
 (0)