feat: Excel export of all projects for full-access admins

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-27 20:44:29 +03:30
co-authored by Cursor
parent a98fdb8d9e
commit 9b11617eab
7 changed files with 2449 additions and 7 deletions
+25
View File
@@ -0,0 +1,25 @@
import { Controller, Get, Res, UseGuards } from '@nestjs/common';
import type { Response } from 'express';
import { JwtAuthGuard } from '../auth/jwt-auth.guard';
import { FullAccessGuard } from '../auth/full-access.guard';
import { ExportService } from './export.service';
@Controller('export')
@UseGuards(JwtAuthGuard, FullAccessGuard)
export class ExportController {
constructor(private readonly exportService: ExportService) {}
@Get('projects.xlsx')
async projectsXlsx(@Res() res: Response) {
const { buffer, filename } = await this.exportService.buildWorkbook();
res.setHeader(
'Content-Type',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
);
res.setHeader(
'Content-Disposition',
`attachment; filename="${filename}"; filename*=UTF-8''${encodeURIComponent(filename)}`,
);
res.send(buffer);
}
}