From faa651ccd0d1f7d963a10b64fa9c15be63a12b2b Mon Sep 17 00:00:00 2001 From: Innei Date: Sat, 12 Mar 2022 15:17:04 +0800 Subject: [PATCH] feat: add snippet aggregate api --- src/modules/snippet/snippet.controller.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/snippet/snippet.controller.ts b/src/modules/snippet/snippet.controller.ts index 4046b180..25eedd35 100644 --- a/src/modules/snippet/snippet.controller.ts +++ b/src/modules/snippet/snippet.controller.ts @@ -59,6 +59,12 @@ export class SnippetController { return snippet } + @Post('/aggregate') + @Auth() + async aggregate(@Body() body: any) { + return this.snippetService.model.aggregate(body) + } + @Get('/:reference/:name') @HTTPDecorators.Bypass @HttpCache({ ttl: 3 }) @@ -86,7 +92,7 @@ export class SnippetController { if (snippet.type === SnippetType.Function) { throw new BadRequestException( - 'this snippet should run in serverless function scope.', + 'this snippet should run in serverless function scope', ) } }