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:
@@ -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