File tree Expand file tree Collapse file tree 2 files changed +27
-23
lines changed Expand file tree Collapse file tree 2 files changed +27
-23
lines changed Original file line number Diff line number Diff line change @@ -280,30 +280,33 @@ impl Server {
280
280
) ,
281
281
)
282
282
. service (
283
- web:: resource ( "/{dashboard_id}" )
284
- . route (
285
- web:: get ( )
286
- . to ( dashboards:: get_dashboard)
287
- . authorize ( Action :: GetDashboard ) ,
288
- )
289
- . route (
290
- web:: delete ( )
291
- . to ( dashboards:: delete_dashboard)
292
- . authorize ( Action :: DeleteDashboard ) ,
283
+ web:: scope ( "/{dashboard_id}" )
284
+ . service (
285
+ web:: resource ( "" )
286
+ . route (
287
+ web:: get ( )
288
+ . to ( dashboards:: get_dashboard)
289
+ . authorize ( Action :: GetDashboard ) ,
290
+ )
291
+ . route (
292
+ web:: delete ( )
293
+ . to ( dashboards:: delete_dashboard)
294
+ . authorize ( Action :: DeleteDashboard ) ,
295
+ )
296
+ . route (
297
+ web:: put ( )
298
+ . to ( dashboards:: update_dashboard)
299
+ . authorize ( Action :: CreateDashboard ) ,
300
+ ) ,
293
301
)
294
- . route (
295
- web:: put ( )
296
- . to ( dashboards:: update_dashboard)
297
- . authorize ( Action :: CreateDashboard ) ,
302
+ . service (
303
+ web:: resource ( "/add_tile" ) . route (
304
+ web:: put ( )
305
+ . to ( dashboards:: add_tile)
306
+ . authorize ( Action :: CreateDashboard ) ,
307
+ ) ,
298
308
) ,
299
309
)
300
- . service (
301
- web:: resource ( "/add_tile" ) . route (
302
- web:: put ( )
303
- . to ( dashboards:: add_tile)
304
- . authorize ( Action :: CreateDashboard ) ,
305
- ) ,
306
- )
307
310
}
308
311
309
312
// get the filters web scope
Original file line number Diff line number Diff line change @@ -294,9 +294,10 @@ impl Dashboards {
294
294
& self ,
295
295
dashboard_id : Ulid ,
296
296
user_id : & str ,
297
- ) -> Result < Dashboard , DashboardError > {
297
+ ) -> Result < ( ) , DashboardError > {
298
298
self . get_dashboard_by_user ( dashboard_id, user_id)
299
299
. await
300
- . ok_or ( DashboardError :: Unauthorized )
300
+ . ok_or_else ( || DashboardError :: Unauthorized )
301
+ . map ( |_| ( ) )
301
302
}
302
303
}
You can’t perform that action at this time.
0 commit comments