| import { Controller, Delete, Get, Param } from '@nestjs/common'; | |
| import { GetUserFromRequest } from '@gitroom/nestjs-libraries/user/user.from.request'; | |
| import { User } from '@prisma/client'; | |
| import { ApiTags } from '@nestjs/swagger'; | |
| import { OAuthService } from '@gitroom/nestjs-libraries/database/prisma/oauth/oauth.service'; | |
| ('Approved Apps') | |
| ('/user/approved-apps') | |
| export class ApprovedAppsController { | |
| constructor(private _oauthService: OAuthService) {} | |
| ('/') | |
| async list(() user: User) { | |
| return this._oauthService.getApprovedApps(user.id); | |
| } | |
| ('/:id') | |
| async revoke( | |
| () user: User, | |
| ('id') id: string | |
| ) { | |
| return this._oauthService.revokeApp(user.id, id); | |
| } | |
| } | |