feat: implement project settings management with CRUD operations and caching

This commit is contained in:
lborv
2025-10-13 20:40:01 +03:00
parent aa7920384c
commit 93f12cd1d8
14 changed files with 304 additions and 17 deletions

View File

@ -1,6 +1,7 @@
import { Controller, Inject, Post, UseGuards } from "@nestjs/common";
import { Controller, Inject, Post, Req, UseGuards } from "@nestjs/common";
import { ApiTokenGuard } from "src/api/guards/api-token.guard";
import { FunctionService } from "./function.service";
import { Token } from "src/api/entities/token.entity";
@Controller("functions")
@UseGuards(ApiTokenGuard)
@ -11,12 +12,19 @@ export class FunctionController {
) {}
@Post("create")
async createFunction(projectId: string, name: string, source: string) {
return this.functionService.create(projectId, name, source);
async createFunction(
@Req() req: Request & { apiToken: Token },
name: string,
source: string
) {
return this.functionService.create(req.apiToken.project.id, name, source);
}
@Post("delete")
async deleteFunction(projectId: string, name: string) {
return this.functionService.deleteFunction(projectId, name);
async deleteFunction(
@Req() req: Request & { apiToken: Token },
name: string
) {
return this.functionService.deleteFunction(req.apiToken.project.id, name);
}
}