All files / src/endpoints setLocale.ts

16.66% Statements 1/6
100% Branches 0/0
0% Functions 0/1
16.66% Lines 1/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16          2x                    
import { Request, Response } from "express"
import pino from "pino"
 
import DynamicConfig, { VConfig } from "../modules/config/dynamic"
 
const logger = pino()
 
export async function setLocale(req: Request<unknown, unknown, { locale: string }>, res: Response) {
  const { locale } = req.body
  logger.info("=================================== Setting Locale ===================================")
 
  logger.info("Setting locale field %s", locale)
  await DynamicConfig.set(VConfig.Locale, locale)
  return res.status(201).send({})
}