Skip to content

Commit

Permalink
add validation to dashboard endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: ianmuchyri <[email protected]>
  • Loading branch information
ianmuchyri committed Jan 23, 2024
1 parent 415f0eb commit ac22ed5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ui/api/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ func indexEndpoint(svc ui.Service) endpoint.Endpoint {
func dashboardsEndpoint(svc ui.Service) endpoint.Endpoint {
return func(_ context.Context, request interface{}) (interface{}, error) {
req := request.(dashboardsReq)
if err := req.validate(); err != nil {
return nil, err
}

res, err := svc.Dashboards(req.token)
if err != nil {
Expand Down

0 comments on commit ac22ed5

Please sign in to comment.