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 @@ -260,30 +260,33 @@ impl Server {
260
260
) ,
261
261
)
262
262
. service (
263
- web:: resource ( "/{dashboard_id}" )
264
- . route (
265
- web:: get ( )
266
- . to ( dashboards:: get_dashboard)
267
- . authorize ( Action :: GetDashboard ) ,
268
- )
269
- . route (
270
- web:: delete ( )
271
- . to ( dashboards:: delete_dashboard)
272
- . authorize ( Action :: DeleteDashboard ) ,
263
+ web:: scope ( "/{dashboard_id}" )
264
+ . service (
265
+ web:: resource ( "" )
266
+ . route (
267
+ web:: get ( )
268
+ . to ( dashboards:: get_dashboard)
269
+ . authorize ( Action :: GetDashboard ) ,
270
+ )
271
+ . route (
272
+ web:: delete ( )
273
+ . to ( dashboards:: delete_dashboard)
274
+ . authorize ( Action :: DeleteDashboard ) ,
275
+ )
276
+ . route (
277
+ web:: put ( )
278
+ . to ( dashboards:: update_dashboard)
279
+ . authorize ( Action :: CreateDashboard ) ,
280
+ ) ,
273
281
)
274
- . route (
275
- web:: put ( )
276
- . to ( dashboards:: update_dashboard)
277
- . authorize ( Action :: CreateDashboard ) ,
282
+ . service (
283
+ web:: resource ( "/add_tile" ) . route (
284
+ web:: put ( )
285
+ . to ( dashboards:: add_tile)
286
+ . authorize ( Action :: CreateDashboard ) ,
287
+ ) ,
278
288
) ,
279
289
)
280
- . service (
281
- web:: resource ( "/add_tile" ) . route (
282
- web:: put ( )
283
- . to ( dashboards:: add_tile)
284
- . authorize ( Action :: CreateDashboard ) ,
285
- ) ,
286
- )
287
290
}
288
291
289
292
// 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