chore: Move admin region tests (#7582)

This commit is contained in:
Oli Juhl authored and GitHub committed 2024-06-03 14:25:43 +02:00
1 parent b299aec620
commit 0c0c510a37
4 files changed
+284 -483

No files matched your search

@@ -2,6 +2,7 @@ import {
deleteRegionsWorkflow,
updateRegionsWorkflow,
} from "@medusajs/core-flows"
import { MedusaError } from "@medusajs/utils"
import {
AuthenticatedMedusaRequest,
MedusaResponse,
@@ -18,6 +19,14 @@ export const GET = async (
req.scope,
req.remoteQueryConfig.fields
)
if (!region) {
throw new MedusaError(
MedusaError.Types.NOT_FOUND,
`Region with id: ${req.params.id} not found`
)
}
res.status(200).json({ region })
}
@@ -14,6 +14,7 @@ import {
} from "@medusajs/types"
import {
arrayDifference,
getDuplicates,
InjectManager,
InjectTransactionManager,
isString,
@@ -22,7 +23,6 @@ import {
ModulesSdkUtils,
promiseAll,
removeUndefined,
getDuplicates,
} from "@medusajs/utils"
import { Country, Region } from "@models"