src/module/locales/locales.controller.ts
locales
Methods |
|
Async markMissingLocaleKey | ||||||||||||
markMissingLocaleKey(lang: string, namespace: string, missingKeys: Record
|
||||||||||||
Decorators :
@Post('/:lang/:namespace')
|
||||||||||||
Defined in src/module/locales/locales.controller.ts:12
|
||||||||||||
Parameters :
Returns :
Promise<void>
|
import { Body, Controller, HttpCode, HttpStatus, Param, Post, UseGuards } from '@nestjs/common';
import { AuthenticatedGuard } from '../../guards/authenticated.guard';
import { LocalesService, MissingKeyContainer } from './locales.service';
@Controller('locales')
export class LocalesController {
constructor(private readonly localesService: LocalesService) {}
@Post('/:lang/:namespace')
@UseGuards(AuthenticatedGuard)
@HttpCode(HttpStatus.NO_CONTENT)
async markMissingLocaleKey(
@Param('lang') lang: string,
@Param('namespace') namespace: string,
@Body() missingKeys: Record<string, string>
): Promise<void> {
const container = new MissingKeyContainer(missingKeys);
this.localesService.addMissingLanguageKey({
lang,
namespace,
container,
});
}
}