chore(): Add translations/locale integration tests and fix locale endpoint (#14266)

* chore(): Add translations/locale integration tests and fix locale end point

* Create selfish-dots-shop.md
This commit is contained in:
Adrien de Peretti
2025-12-10 13:45:35 +01:00
committed by GitHub
parent e4877616c3
commit dd74ce34ba
5 changed files with 894 additions and 12 deletions
@@ -1,4 +1,7 @@
import { ContainerRegistrationKeys } from "@medusajs/framework/utils"
import {
ContainerRegistrationKeys,
MedusaError,
} from "@medusajs/framework/utils"
import { MedusaRequest, MedusaResponse } from "@medusajs/framework/http"
import { HttpTypes } from "@medusajs/framework/types"
@@ -20,9 +23,15 @@ export const GET = async (
},
{
cache: { enable: true },
throwIfKeyNotFound: true,
}
)
if (!locale) {
throw new MedusaError(
MedusaError.Types.NOT_FOUND,
`Locale with code: ${req.params.code} was not found`
)
}
res.status(200).json({ locale })
}