chore(types, medusa): [3/3] add missing query type arguments (#8880)
Add missing type arguments in listing requests. 3/3
This commit is contained in:
@@ -12,7 +12,7 @@ import { refetchCustomer } from "../../helpers"
|
||||
import { AdditionalData, HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.AdminCustomerAddressFilters>,
|
||||
res: MedusaResponse<HttpTypes.AdminCustomerAddressListResponse>
|
||||
) => {
|
||||
const customerId = req.params.id
|
||||
|
||||
@@ -9,15 +9,11 @@ import {
|
||||
|
||||
import { createStockLocationsWorkflow } from "@medusajs/core-flows"
|
||||
import { refetchStockLocation } from "./helpers"
|
||||
import {
|
||||
AdminCreateStockLocationType,
|
||||
AdminGetStockLocationsParamsType,
|
||||
} from "./validators"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
// Create stock location
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<AdminCreateStockLocationType>,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.AdminCreateStockLocation>,
|
||||
res: MedusaResponse<HttpTypes.AdminStockLocationResponse>
|
||||
) => {
|
||||
const { result } = await createStockLocationsWorkflow(req.scope).run({
|
||||
@@ -34,7 +30,7 @@ export const POST = async (
|
||||
}
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest<AdminGetStockLocationsParamsType>,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.AdminStockLocationListParams>,
|
||||
res: MedusaResponse<HttpTypes.AdminStockLocationListResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
@@ -6,11 +6,10 @@ import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
} from "../../../types/routing"
|
||||
import { AdminGetStoresParamsType } from "./validators"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest<AdminGetStoresParamsType>,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.AdminStoreListParams>,
|
||||
res: MedusaResponse<HttpTypes.AdminStoreListResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
@@ -8,14 +8,10 @@ import {
|
||||
MedusaResponse,
|
||||
} from "../../../types/routing"
|
||||
import { refetchTaxRate } from "./helpers"
|
||||
import {
|
||||
AdminCreateTaxRateType,
|
||||
AdminGetTaxRatesParamsType,
|
||||
} from "./validators"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<AdminCreateTaxRateType>,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.AdminCreateTaxRate>,
|
||||
res: MedusaResponse<HttpTypes.AdminTaxRateResponse>
|
||||
) => {
|
||||
const { result } = await createTaxRatesWorkflow(req.scope).run({
|
||||
@@ -36,7 +32,7 @@ export const POST = async (
|
||||
}
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest<AdminGetTaxRatesParamsType>,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.AdminTaxRateListParams>,
|
||||
res: MedusaResponse<HttpTypes.AdminTaxRateListResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
@@ -7,15 +7,11 @@ import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
} from "../../../types/routing"
|
||||
import {
|
||||
AdminCreateTaxRegionType,
|
||||
AdminGetTaxRegionsParamsType,
|
||||
} from "./validators"
|
||||
import { refetchTaxRegion } from "./helpers"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<AdminCreateTaxRegionType>,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.AdminCreateTaxRegion>,
|
||||
res: MedusaResponse<HttpTypes.AdminTaxRegionResponse>
|
||||
) => {
|
||||
const { result } = await createTaxRegionsWorkflow(req.scope).run({
|
||||
@@ -36,7 +32,7 @@ export const POST = async (
|
||||
}
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest<AdminGetTaxRegionsParamsType>,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.AdminTaxRegionListParams>,
|
||||
res: MedusaResponse<HttpTypes.AdminTaxRegionListResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
@@ -4,11 +4,10 @@ import {
|
||||
MedusaResponse,
|
||||
} from "../../../types/routing"
|
||||
import { MedusaError } from "@medusajs/utils"
|
||||
import { AdminGetUploadParamsType } from "./validators"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<AdminGetUploadParamsType>,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.AdminUploadFile>,
|
||||
res: MedusaResponse<HttpTypes.AdminFileListResponse>
|
||||
) => {
|
||||
const input = req.files as Express.Multer.File[]
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
} from "../../../types/routing"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.AdminUserListParams>,
|
||||
res: MedusaResponse<HttpTypes.AdminUserListResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
@@ -3,15 +3,13 @@ import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
} from "../../../types/routing"
|
||||
|
||||
import { AdminGetWorkflowExecutionsParamsType } from "./validators"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
remoteQueryObjectFromString,
|
||||
} from "@medusajs/utils"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest<AdminGetWorkflowExecutionsParamsType>,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.AdminGetWorkflowExecutionsParams>,
|
||||
res: MedusaResponse<HttpTypes.AdminWorkflowExecutionListResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
} from "@medusajs/utils"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.StoreCollectionFilters>,
|
||||
res: MedusaResponse<HttpTypes.StoreCollectionListResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
@@ -6,7 +6,7 @@ import { MedusaRequest, MedusaResponse } from "../../../types/routing"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const GET = async (
|
||||
req: MedusaRequest,
|
||||
req: MedusaRequest<HttpTypes.StoreGetCurrencyListParams>,
|
||||
res: MedusaResponse<HttpTypes.StoreCurrencyListResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
@@ -6,11 +6,10 @@ import { MedusaError } from "@medusajs/utils"
|
||||
|
||||
import { createCustomerAccountWorkflow } from "@medusajs/core-flows"
|
||||
import { refetchCustomer } from "./helpers"
|
||||
import { StoreCreateCustomerType } from "./validators"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<StoreCreateCustomerType>,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.StoreCreateCustomer>,
|
||||
res: MedusaResponse<HttpTypes.StoreCustomerResponse>
|
||||
) => {
|
||||
// If `actor_id` is present, the request carries authentication for an existing customer
|
||||
|
||||
@@ -6,11 +6,10 @@ import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
} from "../../../types/routing"
|
||||
import { AdminGetOrdersParamsType } from "../../admin/draft-orders/validators"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest<AdminGetOrdersParamsType>,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.StoreOrderFilters>,
|
||||
res: MedusaResponse<HttpTypes.StoreOrderListResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
@@ -7,11 +7,10 @@ import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
} from "../../../types/routing"
|
||||
import { StoreCreatePaymentCollectionType } from "./validators"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<StoreCreatePaymentCollectionType>,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.StoreCreatePaymentCollection>,
|
||||
res: MedusaResponse<HttpTypes.StorePaymentCollectionResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
@@ -7,12 +7,11 @@ import {
|
||||
MedusaError,
|
||||
remoteQueryObjectFromString,
|
||||
} from "@medusajs/utils"
|
||||
import { StoreGetPaymentProvidersParamsType } from "./validators"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
// TODO: Add more fields to provider, such as default name and maybe logo.
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest<StoreGetPaymentProvidersParamsType>,
|
||||
req: AuthenticatedMedusaRequest<HttpTypes.StorePaymentProviderFilters>,
|
||||
res: MedusaResponse<HttpTypes.StorePaymentProviderListResponse>
|
||||
) => {
|
||||
if (!req.filterableFields.region_id) {
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { StoreProductCategoryListResponse } from "@medusajs/types"
|
||||
import {
|
||||
StoreProductCategoryListParams,
|
||||
StoreProductCategoryListResponse,
|
||||
} from "@medusajs/types"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
remoteQueryObjectFromString,
|
||||
@@ -7,10 +10,9 @@ import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
} from "../../../types/routing"
|
||||
import { StoreProductCategoriesParamsType } from "./validators"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest<StoreProductCategoriesParamsType>,
|
||||
req: AuthenticatedMedusaRequest<StoreProductCategoryListParams>,
|
||||
res: MedusaResponse<StoreProductCategoryListResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
@@ -5,12 +5,11 @@ import {
|
||||
} from "@medusajs/utils"
|
||||
import { MedusaResponse } from "../../../types/routing"
|
||||
import { wrapVariantsWithInventoryQuantity } from "../../utils/middlewares"
|
||||
import { StoreGetProductsParamsType } from "./validators"
|
||||
import { RequestWithContext, wrapProductsWithTaxPrices } from "./helpers"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const GET = async (
|
||||
req: RequestWithContext<StoreGetProductsParamsType>,
|
||||
req: RequestWithContext<HttpTypes.StoreProductParams>,
|
||||
res: MedusaResponse<HttpTypes.StoreProductListResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
@@ -6,7 +6,7 @@ import { MedusaRequest, MedusaResponse } from "../../../types/routing"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const GET = async (
|
||||
req: MedusaRequest,
|
||||
req: MedusaRequest<HttpTypes.StoreRegionFilters>,
|
||||
res: MedusaResponse<HttpTypes.StoreRegionListResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { createAndCompleteReturnOrderWorkflow } from "@medusajs/core-flows"
|
||||
import { MedusaRequest, MedusaResponse } from "../../../types/routing"
|
||||
import { StorePostReturnsReqSchemaType } from "./validators"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const POST = async (
|
||||
req: MedusaRequest<StorePostReturnsReqSchemaType>,
|
||||
req: MedusaRequest<HttpTypes.StoreCreateReturn>,
|
||||
res: MedusaResponse<HttpTypes.StoreReturnResponse>
|
||||
) => {
|
||||
const input = req.validatedBody as StorePostReturnsReqSchemaType
|
||||
const input = req.validatedBody as HttpTypes.StoreCreateReturn
|
||||
|
||||
const workflow = createAndCompleteReturnOrderWorkflow(req.scope)
|
||||
const { result } = await workflow.run({
|
||||
|
||||
@@ -4,7 +4,7 @@ import { MedusaError, ModuleRegistrationName } from "@medusajs/utils"
|
||||
import { MedusaRequest, MedusaResponse } from "../../../types/routing"
|
||||
|
||||
export const GET = async (
|
||||
req: MedusaRequest,
|
||||
req: MedusaRequest<HttpTypes.StoreGetShippingOptionList>,
|
||||
res: MedusaResponse<HttpTypes.StoreShippingOptionListResponse>
|
||||
) => {
|
||||
const { cart_id } = req.filterableFields as { cart_id: string }
|
||||
|
||||
Reference in New Issue
Block a user