chore: fixes to http and request types for users (#13828)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-10-28 10:08:51 +01:00
1 parent aa34d0fe9c
commit 83f2d87fa5
5 files changed
+12 -7

No files matched your search

@@ -5,7 +5,7 @@ import { refetchInvite } from "../../helpers"
import { HttpTypes } from "@medusajs/framework/types" import { HttpTypes } from "@medusajs/framework/types"
export const POST = async ( export const POST = async (
req: MedusaRequest, req: MedusaRequest<{}, HttpTypes.SelectParams>,
res: MedusaResponse<HttpTypes.AdminInviteResponse> res: MedusaResponse<HttpTypes.AdminInviteResponse>
) => { ) => {
const workflow = refreshInviteTokensWorkflow(req.scope) const workflow = refreshInviteTokensWorkflow(req.scope)
@@ -9,7 +9,7 @@ import { refetchInvite } from "../helpers"
import { HttpTypes } from "@medusajs/framework/types" import { HttpTypes } from "@medusajs/framework/types"
export const GET = async ( export const GET = async (
req: AuthenticatedMedusaRequest, req: AuthenticatedMedusaRequest<HttpTypes.SelectParams>,
res: MedusaResponse<HttpTypes.AdminInviteResponse> res: MedusaResponse<HttpTypes.AdminInviteResponse>
) => { ) => {
const { id } = req.params const { id } = req.params
@@ -36,7 +36,10 @@ export const GET = async (
} }
export const POST = async ( export const POST = async (
req: AuthenticatedMedusaRequest<HttpTypes.AdminCreateInvite>, req: AuthenticatedMedusaRequest<
HttpTypes.AdminCreateInvite,
HttpTypes.SelectParams
>,
res: MedusaResponse<HttpTypes.AdminInviteResponse> res: MedusaResponse<HttpTypes.AdminInviteResponse>
) => { ) => {
const workflow = createInvitesWorkflow(req.scope) const workflow = createInvitesWorkflow(req.scope)
@@ -14,11 +14,10 @@ import {
remoteQueryObjectFromString, remoteQueryObjectFromString,
} from "@medusajs/framework/utils" } from "@medusajs/framework/utils"
import { refetchUser } from "../helpers" import { refetchUser } from "../helpers"
import { AdminUpdateUserType } from "../validators"
// Get user // Get user
export const GET = async ( export const GET = async (
req: AuthenticatedMedusaRequest, req: AuthenticatedMedusaRequest<HttpTypes.AdminUserParams>,
res: MedusaResponse<HttpTypes.AdminUserResponse> res: MedusaResponse<HttpTypes.AdminUserResponse>
) => { ) => {
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY) const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
@@ -43,7 +42,10 @@ export const GET = async (
// update user // update user
export const POST = async ( export const POST = async (
req: AuthenticatedMedusaRequest<AdminUpdateUserType>, req: AuthenticatedMedusaRequest<
HttpTypes.AdminUpdateUser,
HttpTypes.AdminUserParams
>,
res: MedusaResponse<HttpTypes.AdminUserResponse> res: MedusaResponse<HttpTypes.AdminUserResponse>
) => { ) => {
const workflow = updateUsersWorkflow(req.scope) const workflow = updateUsersWorkflow(req.scope)
@@ -10,7 +10,7 @@ import {
import { HttpTypes } from "@medusajs/framework/types" import { HttpTypes } from "@medusajs/framework/types"
export const GET = async ( export const GET = async (
req: AuthenticatedMedusaRequest, req: AuthenticatedMedusaRequest<HttpTypes.AdminUserParams>,
res: MedusaResponse<HttpTypes.AdminUserResponse> res: MedusaResponse<HttpTypes.AdminUserResponse>
) => { ) => {
const id = req.auth_context.actor_id const id = req.auth_context.actor_id