Last active
June 10, 2020 13:08
-
-
Save ojhaujjwal/3810d52e5117e76ff3b6951680ae90ce to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Controller, Get } from '@nestjs/common'; | |
import { AuthenticationGuard, AccessControlGuard } from 'app/decorators'; | |
@Controller({ path: '/admin/dashboard' }) | |
@AuthenticationGuard() | |
@AccessControlGuard({ role: 'admin' }) | |
export class AdminDashboardController { | |
@Get() | |
index(): string { | |
return 'dashboard data for admin'; | |
} | |
} | |
@Controller({ path: '/admin/posts' }) | |
@AuthenticationGuard() | |
@AccessControlGuard({ role: 'admin' }) | |
export class AdminPostsController { | |
@Get() | |
findPaginated(): string { | |
return 'all posts for the page'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment