feat: implement QuestionBank CRUD with pagination and template query
- Add pagination support to findAll (page, limit query params) - Add findByTemplateId method to service - Add GET /by-template/:templateId endpoint to controller - Service already includes CRUD for QuestionBank and QuestionBankItem
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { Injectable, NestMiddleware } from '@nestjs/common';
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import { i18nStore } from './i18n.store';
|
||||
import { DEFAULT_LANGUAGE } from '../common/constants';
|
||||
|
||||
@Injectable()
|
||||
export class I18nMiddleware implements NestMiddleware {
|
||||
use(req: Request, res: Response, next: NextFunction) {
|
||||
const language = req.headers['x-user-language'] || DEFAULT_LANGUAGE;
|
||||
i18nStore.run({ language: String(language) }, () => {
|
||||
next();
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user