chore: use framework sub paths everywhere (#9253)
This commit is contained in:
committed by
GitHub
parent
48bea267dc
commit
a8e19faf8d
@@ -2,7 +2,7 @@ import {
|
||||
removeUserAccountWorkflow,
|
||||
updateUsersWorkflow,
|
||||
} from "@medusajs/core-flows"
|
||||
import { HttpTypes, UpdateUserDTO } from "@medusajs/types"
|
||||
import { HttpTypes, UpdateUserDTO } from "@medusajs/framework/types"
|
||||
import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
ContainerRegistrationKeys,
|
||||
MedusaError,
|
||||
remoteQueryObjectFromString,
|
||||
} from "@medusajs/utils"
|
||||
} from "@medusajs/framework/utils"
|
||||
import { refetchUser } from "../helpers"
|
||||
import { AdminUpdateUserType } from "../validators"
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { MedusaContainer } from "@medusajs/types"
|
||||
import { MedusaContainer } from "@medusajs/framework/types"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
remoteQueryObjectFromString,
|
||||
} from "@medusajs/utils"
|
||||
} from "@medusajs/framework/utils"
|
||||
|
||||
export const refetchUser = async (
|
||||
userId: string,
|
||||
|
||||
@@ -2,12 +2,12 @@ import {
|
||||
ContainerRegistrationKeys,
|
||||
MedusaError,
|
||||
remoteQueryObjectFromString,
|
||||
} from "@medusajs/utils"
|
||||
} from "@medusajs/framework/utils"
|
||||
import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
} from "../../../../types/routing"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
import { HttpTypes } from "@medusajs/framework/types"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { MiddlewareRoute } from "@medusajs/framework"
|
||||
import { MiddlewareRoute } from "@medusajs/framework/http"
|
||||
import { authenticate } from "../../../utils/middlewares/authenticate-middleware"
|
||||
import { validateAndTransformBody } from "../../utils/validate-body"
|
||||
import { validateAndTransformQuery } from "../../utils/validate-query"
|
||||
@@ -6,7 +6,7 @@ import * as QueryConfig from "./query-config"
|
||||
import {
|
||||
AdminGetUserParams,
|
||||
AdminGetUsersParams,
|
||||
AdminUpdateUser
|
||||
AdminUpdateUser,
|
||||
} from "./validators"
|
||||
|
||||
// TODO: Due to issues with our routing (and using router.use for applying middlewares), we have to opt-out of global auth in all routes, and then reapply it here.
|
||||
@@ -29,8 +29,8 @@ export const adminUserRoutesMiddlewares: MiddlewareRoute[] = [
|
||||
middlewares: [
|
||||
authenticate("user", ["bearer", "session"]),
|
||||
validateAndTransformQuery(
|
||||
AdminGetUserParams,
|
||||
QueryConfig.retrieveTransformQueryConfig
|
||||
AdminGetUserParams,
|
||||
QueryConfig.retrieveTransformQueryConfig
|
||||
),
|
||||
],
|
||||
},
|
||||
@@ -40,8 +40,8 @@ export const adminUserRoutesMiddlewares: MiddlewareRoute[] = [
|
||||
middlewares: [
|
||||
authenticate("user", ["bearer", "session"]),
|
||||
validateAndTransformQuery(
|
||||
AdminGetUserParams,
|
||||
QueryConfig.retrieveTransformQueryConfig
|
||||
AdminGetUserParams,
|
||||
QueryConfig.retrieveTransformQueryConfig
|
||||
),
|
||||
],
|
||||
},
|
||||
@@ -52,8 +52,8 @@ export const adminUserRoutesMiddlewares: MiddlewareRoute[] = [
|
||||
authenticate("user", ["bearer", "session"]),
|
||||
validateAndTransformBody(AdminUpdateUser),
|
||||
validateAndTransformQuery(
|
||||
AdminGetUserParams,
|
||||
QueryConfig.retrieveTransformQueryConfig
|
||||
AdminGetUserParams,
|
||||
QueryConfig.retrieveTransformQueryConfig
|
||||
),
|
||||
],
|
||||
},
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
import { HttpTypes } from "@medusajs/framework/types"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
remoteQueryObjectFromString,
|
||||
} from "@medusajs/utils"
|
||||
} from "@medusajs/framework/utils"
|
||||
import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
|
||||
Reference in New Issue
Block a user