2021-07-11 05:13:51 +00:00
|
|
|
import { Controller, Post, Request, UseGuards } from '@nestjs/common';
|
|
|
|
|
import { decamelizeKeys } from 'humps';
|
2021-07-14 14:14:35 +00:00
|
|
|
import { JwtAuthGuard } from '../../src/modules/auth/jwt-auth.guard';
|
2021-07-11 05:39:55 +00:00
|
|
|
import { FolderAppsService } from '../services/folder_apps.service';
|
2021-07-11 05:13:51 +00:00
|
|
|
|
|
|
|
|
@Controller('folder_apps')
|
|
|
|
|
export class FolderAppsController {
|
|
|
|
|
constructor(
|
|
|
|
|
private folderAppsService: FolderAppsService
|
|
|
|
|
) { }
|
|
|
|
|
|
|
|
|
|
@UseGuards(JwtAuthGuard)
|
|
|
|
|
@Post()
|
|
|
|
|
async create(@Request() req) {
|
|
|
|
|
const folderId = req.body.folder_id;
|
|
|
|
|
const appId = req.body.app_id;
|
|
|
|
|
|
|
|
|
|
const folder = await this.folderAppsService.create(req.user, folderId, appId);
|
|
|
|
|
return decamelizeKeys(folder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|