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:
committed by
GitHub
parent
e4877616c3
commit
dd74ce34ba
@@ -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 })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user