16 lines
491 B
TypeScript
16 lines
491 B
TypeScript
import { Body, Controller, Post } from "@nestjs/common";
|
|
import { MigrationService } from "./migration.service";
|
|
import { MigrationTable } from "./migration.constants";
|
|
|
|
@Controller("migrations")
|
|
export class MigrationController {
|
|
constructor(private readonly migrationService: MigrationService) {}
|
|
|
|
@Post("create")
|
|
async createMigration(
|
|
@Body() body: { token: string; tables: MigrationTable[] }
|
|
) {
|
|
return await this.migrationService.create(body.tables, body.token);
|
|
}
|
|
}
|