chore(medusa,types): [9] Add request types to API routes (#8566)
This commit is contained in:
@@ -1,65 +0,0 @@
|
||||
import { AdminPaymentCollection } from "../payment/admin"
|
||||
import {
|
||||
BaseOrder,
|
||||
BaseOrderAddress,
|
||||
BaseOrderChange,
|
||||
BaseOrderChangeAction,
|
||||
BaseOrderFilters,
|
||||
BaseOrderLineItem,
|
||||
BaseOrderShippingMethod,
|
||||
} from "./common"
|
||||
|
||||
export interface AdminOrder extends BaseOrder {
|
||||
payment_collections: AdminPaymentCollection[]
|
||||
}
|
||||
|
||||
export interface AdminOrderLineItem extends BaseOrderLineItem {}
|
||||
export interface AdminOrderFilters extends BaseOrderFilters {}
|
||||
export interface AdminOrderAddress extends BaseOrderAddress {}
|
||||
export interface AdminOrderShippingMethod extends BaseOrderShippingMethod {}
|
||||
|
||||
export interface AdminOrderResponse {
|
||||
order: AdminOrder
|
||||
}
|
||||
|
||||
export interface AdminOrdersResponse {
|
||||
orders: AdminOrder[]
|
||||
}
|
||||
|
||||
export interface AdminCreateOrderFulfillment {
|
||||
items: { id: string; quantity: number }[]
|
||||
location_id?: string
|
||||
no_notification?: boolean
|
||||
metadata?: Record<string, any>
|
||||
}
|
||||
|
||||
export interface AdminCreateOrderShipment {
|
||||
items: { id: string; quantity: number }[]
|
||||
labels?: {
|
||||
tracking_number: string
|
||||
tracking_url: string
|
||||
label_url: string
|
||||
}[]
|
||||
no_notification?: boolean
|
||||
metadata?: Record<string, any>
|
||||
}
|
||||
|
||||
export interface AdminCancelOrderFulfillment {
|
||||
no_notification?: boolean
|
||||
}
|
||||
|
||||
// Order Preview
|
||||
|
||||
export interface AdminOrderPreview
|
||||
extends Omit<AdminOrder, "items" | "shipping_methods"> {
|
||||
return_requested_total: number
|
||||
order_change: BaseOrderChange
|
||||
items: (BaseOrderLineItem & { actions?: BaseOrderChangeAction[] })[]
|
||||
shipping_methods: (BaseOrderShippingMethod & {
|
||||
actions?: BaseOrderChangeAction[]
|
||||
})[]
|
||||
}
|
||||
|
||||
export interface AdminOrderPreviewResponse {
|
||||
order: AdminOrderPreview
|
||||
}
|
||||
26
packages/core/types/src/http/order/admin/entities.ts
Normal file
26
packages/core/types/src/http/order/admin/entities.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { AdminPaymentCollection } from "../../payment/admin"
|
||||
import {
|
||||
BaseOrder,
|
||||
BaseOrderAddress,
|
||||
BaseOrderChange,
|
||||
BaseOrderChangeAction,
|
||||
BaseOrderLineItem,
|
||||
BaseOrderShippingMethod,
|
||||
} from "../common"
|
||||
|
||||
export interface AdminOrder extends BaseOrder {
|
||||
payment_collections: AdminPaymentCollection[]
|
||||
}
|
||||
|
||||
export interface AdminOrderLineItem extends BaseOrderLineItem {}
|
||||
export interface AdminOrderAddress extends BaseOrderAddress {}
|
||||
export interface AdminOrderShippingMethod extends BaseOrderShippingMethod {}
|
||||
export interface AdminOrderPreview
|
||||
extends Omit<AdminOrder, "items" | "shipping_methods"> {
|
||||
return_requested_total: number
|
||||
order_change: BaseOrderChange
|
||||
items: (BaseOrderLineItem & { actions?: BaseOrderChangeAction[] })[]
|
||||
shipping_methods: (BaseOrderShippingMethod & {
|
||||
actions?: BaseOrderChangeAction[]
|
||||
})[]
|
||||
}
|
||||
4
packages/core/types/src/http/order/admin/index.ts
Normal file
4
packages/core/types/src/http/order/admin/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export * from "./entities"
|
||||
export * from "./payload"
|
||||
export * from "./queries"
|
||||
export * from "./responses"
|
||||
21
packages/core/types/src/http/order/admin/payload.ts
Normal file
21
packages/core/types/src/http/order/admin/payload.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
export interface AdminCreateOrderFulfillment {
|
||||
items: { id: string; quantity: number }[]
|
||||
location_id?: string
|
||||
no_notification?: boolean
|
||||
metadata?: Record<string, any>
|
||||
}
|
||||
|
||||
export interface AdminCreateOrderShipment {
|
||||
items: { id: string; quantity: number }[]
|
||||
labels?: {
|
||||
tracking_number: string
|
||||
tracking_url: string
|
||||
label_url: string
|
||||
}[]
|
||||
no_notification?: boolean
|
||||
metadata?: Record<string, any>
|
||||
}
|
||||
|
||||
export interface AdminCancelOrderFulfillment {
|
||||
no_notification?: boolean
|
||||
}
|
||||
3
packages/core/types/src/http/order/admin/queries.ts
Normal file
3
packages/core/types/src/http/order/admin/queries.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { BaseOrderFilters } from "../common";
|
||||
|
||||
export interface AdminOrderFilters extends BaseOrderFilters {}
|
||||
14
packages/core/types/src/http/order/admin/responses.ts
Normal file
14
packages/core/types/src/http/order/admin/responses.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { PaginatedResponse } from "../../common"
|
||||
import { AdminOrder, AdminOrderPreview } from "./entities"
|
||||
|
||||
export interface AdminOrderResponse {
|
||||
order: AdminOrder
|
||||
}
|
||||
|
||||
export type AdminOrderListResponse = PaginatedResponse<{
|
||||
orders: AdminOrder[]
|
||||
}>
|
||||
|
||||
export interface AdminOrderPreviewResponse {
|
||||
order: AdminOrderPreview
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
import { BaseFilterable } from "../../dal"
|
||||
import {
|
||||
BasePayment,
|
||||
BasePaymentCollection,
|
||||
BasePaymentCollectionFilters,
|
||||
BasePaymentFilters,
|
||||
BasePaymentProvider,
|
||||
BasePaymentProviderFilters,
|
||||
BasePaymentSession,
|
||||
BasePaymentSessionFilters,
|
||||
BaseRefund,
|
||||
RefundReason,
|
||||
} from "./common"
|
||||
|
||||
export interface AdminPaymentProvider extends BasePaymentProvider {
|
||||
is_enabled: boolean
|
||||
}
|
||||
|
||||
export interface AdminPayment extends BasePayment {}
|
||||
export interface AdminPaymentCollection extends BasePaymentCollection {}
|
||||
export interface AdminPaymentSession extends BasePaymentSession {}
|
||||
|
||||
export interface AdminPaymentProviderFilters
|
||||
extends BasePaymentProviderFilters {
|
||||
is_enabled?: boolean
|
||||
}
|
||||
export interface AdminPaymentCollectionFilters
|
||||
extends BasePaymentCollectionFilters {}
|
||||
export interface AdminPaymentSessionFilters extends BasePaymentSessionFilters {}
|
||||
|
||||
export interface AdminCapturePayment {
|
||||
amount?: number
|
||||
}
|
||||
|
||||
export interface AdminRefundPayment {
|
||||
amount?: number
|
||||
refund_reason_id?: string | null
|
||||
note?: string | null
|
||||
}
|
||||
|
||||
export interface AdminPaymentResponse {
|
||||
payment: AdminPayment
|
||||
}
|
||||
|
||||
export interface AdminPaymentsResponse {
|
||||
payments: AdminPayment[]
|
||||
}
|
||||
|
||||
export interface AdminPaymentFilters extends BasePaymentFilters {}
|
||||
|
||||
// Refund
|
||||
|
||||
export interface AdminRefund extends BaseRefund {}
|
||||
export interface RefundFilters extends BaseFilterable<AdminRefund> {
|
||||
id?: string | string[]
|
||||
}
|
||||
|
||||
export interface AdminRefundResponse {
|
||||
refund_reason: AdminRefund
|
||||
}
|
||||
|
||||
export interface AdminRefundsResponse {
|
||||
refund_reasons: AdminRefund[]
|
||||
}
|
||||
|
||||
// Refund reason
|
||||
|
||||
export interface AdminRefundReason extends RefundReason {}
|
||||
export interface RefundReasonFilters extends BaseFilterable<AdminRefundReason> {
|
||||
id?: string | string[]
|
||||
}
|
||||
|
||||
export interface RefundReasonResponse {
|
||||
refund_reason: AdminRefundReason
|
||||
}
|
||||
|
||||
export interface RefundReasonsResponse {
|
||||
refund_reasons: AdminRefundReason[]
|
||||
}
|
||||
|
||||
export interface AdminCreateRefundReason {
|
||||
label: string
|
||||
description?: string
|
||||
}
|
||||
18
packages/core/types/src/http/payment/admin/entities.ts
Normal file
18
packages/core/types/src/http/payment/admin/entities.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import {
|
||||
BasePayment,
|
||||
BasePaymentCollection,
|
||||
BasePaymentProvider,
|
||||
BasePaymentSession,
|
||||
BaseRefund,
|
||||
RefundReason,
|
||||
} from "../common"
|
||||
|
||||
export interface AdminPaymentProvider extends BasePaymentProvider {
|
||||
is_enabled: boolean
|
||||
}
|
||||
|
||||
export interface AdminPayment extends BasePayment {}
|
||||
export interface AdminPaymentCollection extends BasePaymentCollection {}
|
||||
export interface AdminPaymentSession extends BasePaymentSession {}
|
||||
export interface AdminRefund extends BaseRefund {}
|
||||
export interface AdminRefundReason extends RefundReason {}
|
||||
4
packages/core/types/src/http/payment/admin/index.ts
Normal file
4
packages/core/types/src/http/payment/admin/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export * from "./entities"
|
||||
export * from "./payloads"
|
||||
export * from "./queries"
|
||||
export * from "./responses"
|
||||
14
packages/core/types/src/http/payment/admin/payloads.ts
Normal file
14
packages/core/types/src/http/payment/admin/payloads.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export interface AdminCapturePayment {
|
||||
amount?: number
|
||||
}
|
||||
|
||||
export interface AdminRefundPayment {
|
||||
amount?: number
|
||||
refund_reason_id?: string | null
|
||||
note?: string | null
|
||||
}
|
||||
|
||||
export interface AdminCreateRefundReason {
|
||||
label: string
|
||||
description?: string
|
||||
}
|
||||
25
packages/core/types/src/http/payment/admin/queries.ts
Normal file
25
packages/core/types/src/http/payment/admin/queries.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { BaseFilterable } from "../../../dal"
|
||||
import {
|
||||
BasePaymentCollectionFilters,
|
||||
BasePaymentFilters,
|
||||
BasePaymentProviderFilters,
|
||||
BasePaymentSessionFilters,
|
||||
} from "../common"
|
||||
import { AdminRefund, AdminRefundReason } from "./entities"
|
||||
|
||||
export interface AdminPaymentProviderFilters
|
||||
extends BasePaymentProviderFilters {
|
||||
is_enabled?: boolean
|
||||
}
|
||||
export interface AdminPaymentCollectionFilters
|
||||
extends BasePaymentCollectionFilters {}
|
||||
export interface AdminPaymentSessionFilters extends BasePaymentSessionFilters {}
|
||||
|
||||
export interface AdminPaymentFilters extends BasePaymentFilters {}
|
||||
|
||||
export interface RefundFilters extends BaseFilterable<AdminRefund> {
|
||||
id?: string | string[]
|
||||
}
|
||||
export interface RefundReasonFilters extends BaseFilterable<AdminRefundReason> {
|
||||
id?: string | string[]
|
||||
}
|
||||
30
packages/core/types/src/http/payment/admin/responses.ts
Normal file
30
packages/core/types/src/http/payment/admin/responses.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { PaginatedResponse } from "../../common"
|
||||
import { AdminPayment, AdminPaymentProvider, AdminRefund, AdminRefundReason } from "./entities"
|
||||
|
||||
export interface AdminPaymentResponse {
|
||||
payment: AdminPayment
|
||||
}
|
||||
|
||||
export type AdminPaymentsResponse = PaginatedResponse<{
|
||||
payments: AdminPayment[]
|
||||
}>
|
||||
|
||||
export interface AdminRefundResponse {
|
||||
refund_reason: AdminRefund
|
||||
}
|
||||
|
||||
export type AdminRefundsResponse = PaginatedResponse<{
|
||||
refund_reasons: AdminRefund[]
|
||||
}>
|
||||
|
||||
export interface RefundReasonResponse {
|
||||
refund_reason: AdminRefundReason
|
||||
}
|
||||
|
||||
export type RefundReasonsResponse = PaginatedResponse<{
|
||||
refund_reasons: AdminRefundReason[]
|
||||
}>
|
||||
|
||||
export type AdminPaymentProviderListResponse = PaginatedResponse<{
|
||||
payment_providers: AdminPaymentProvider[]
|
||||
}>
|
||||
@@ -4,10 +4,11 @@ import {
|
||||
} from "../../../../types/routing"
|
||||
import { AdminGetNotificationParamsType } from "../validators"
|
||||
import { refetchEntity } from "../../../utils/refetch-entity"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest<AdminGetNotificationParamsType>,
|
||||
res: MedusaResponse
|
||||
res: MedusaResponse<HttpTypes.AdminNotificationResponse>
|
||||
) => {
|
||||
const notification = await refetchEntity(
|
||||
"notification",
|
||||
|
||||
@@ -4,10 +4,11 @@ import {
|
||||
} from "../../../types/routing"
|
||||
import { AdminGetNotificationsParamsType } from "./validators"
|
||||
import { refetchEntities } from "../../utils/refetch-entity"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest<AdminGetNotificationsParamsType>,
|
||||
res: MedusaResponse
|
||||
res: MedusaResponse<HttpTypes.AdminNotificationListResponse>
|
||||
) => {
|
||||
const { rows: notifications, metadata } = await refetchEntities(
|
||||
"notification",
|
||||
|
||||
@@ -8,10 +8,11 @@ import {
|
||||
MedusaResponse,
|
||||
} from "../../../../../types/routing"
|
||||
import { AdminArchiveOrderType } from "../../validators"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<AdminArchiveOrderType>,
|
||||
res: MedusaResponse
|
||||
res: MedusaResponse<HttpTypes.AdminOrderResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
const { id } = req.params
|
||||
|
||||
@@ -7,10 +7,11 @@ import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
} from "../../../../../types/routing"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest,
|
||||
res: MedusaResponse
|
||||
res: MedusaResponse<HttpTypes.AdminOrderResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AdditionalData } from "@medusajs/types"
|
||||
import { AdditionalData, HttpTypes } from "@medusajs/types"
|
||||
import { completeOrderWorkflow } from "@medusajs/core-flows"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
@@ -12,7 +12,7 @@ import { AdminCompleteOrderType } from "../../validators"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<AdminCompleteOrderType & AdditionalData>,
|
||||
res: MedusaResponse
|
||||
res: MedusaResponse<HttpTypes.AdminOrderResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
const { id } = req.params
|
||||
|
||||
@@ -8,13 +8,13 @@ import {
|
||||
MedusaResponse,
|
||||
} from "../../../../../../../types/routing"
|
||||
import { AdminOrderCancelFulfillmentType } from "../../../../validators"
|
||||
import { AdditionalData } from "@medusajs/types"
|
||||
import { AdditionalData, HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<
|
||||
AdminOrderCancelFulfillmentType & AdditionalData
|
||||
>,
|
||||
res: MedusaResponse
|
||||
res: MedusaResponse<HttpTypes.AdminOrderResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
|
||||
@@ -8,13 +8,13 @@ import {
|
||||
MedusaResponse,
|
||||
} from "../../../../../../../types/routing"
|
||||
import { AdminOrderCreateShipmentType } from "../../../../validators"
|
||||
import { AdditionalData } from "@medusajs/types"
|
||||
import { AdditionalData, HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<
|
||||
AdminOrderCreateShipmentType & AdditionalData
|
||||
>,
|
||||
res: MedusaResponse
|
||||
res: MedusaResponse<HttpTypes.AdminOrderResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
|
||||
@@ -8,13 +8,13 @@ import {
|
||||
MedusaResponse,
|
||||
} from "../../../../../types/routing"
|
||||
import { AdminOrderCreateFulfillmentType } from "../../validators"
|
||||
import { AdditionalData } from "@medusajs/types"
|
||||
import { AdditionalData, HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<
|
||||
AdminOrderCreateFulfillmentType & AdditionalData
|
||||
>,
|
||||
res: MedusaResponse
|
||||
res: MedusaResponse<HttpTypes.AdminOrderResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
|
||||
@@ -3,17 +3,20 @@ import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
} from "../../../../../types/routing"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest,
|
||||
res: MedusaResponse
|
||||
res: MedusaResponse<HttpTypes.AdminOrderPreviewResponse>
|
||||
) => {
|
||||
const { id } = req.params
|
||||
|
||||
// NOTE: Consider replacing with remoteQuery when possible
|
||||
const orderModuleService = req.scope.resolve(ModuleRegistrationName.ORDER)
|
||||
|
||||
const order = await orderModuleService.previewOrderChange(id)
|
||||
const order = (await orderModuleService.previewOrderChange(
|
||||
id
|
||||
)) as unknown as HttpTypes.AdminOrderPreview
|
||||
|
||||
res.status(200).json({ order })
|
||||
}
|
||||
|
||||
@@ -7,10 +7,11 @@ import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
} from "../../../../types/routing"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest,
|
||||
res: MedusaResponse
|
||||
res: MedusaResponse<HttpTypes.AdminOrderResponse>
|
||||
) => {
|
||||
const workflow = getOrderDetailWorkflow(req.scope)
|
||||
const { result } = await workflow.run({
|
||||
@@ -20,12 +21,12 @@ export const GET = async (
|
||||
},
|
||||
})
|
||||
|
||||
res.status(200).json({ order: result })
|
||||
res.status(200).json({ order: result as HttpTypes.AdminOrder })
|
||||
}
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest,
|
||||
res: MedusaResponse
|
||||
res: MedusaResponse<HttpTypes.AdminOrderResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getOrdersListWorkflow } from "@medusajs/core-flows"
|
||||
import { OrderDTO } from "@medusajs/types"
|
||||
import { HttpTypes, OrderDTO } from "@medusajs/types"
|
||||
import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest,
|
||||
res: MedusaResponse
|
||||
res: MedusaResponse<HttpTypes.AdminOrderListResponse>
|
||||
) => {
|
||||
const variables = {
|
||||
filters: {
|
||||
@@ -30,7 +30,7 @@ export const GET = async (
|
||||
metadata: any
|
||||
}
|
||||
res.json({
|
||||
orders: rows,
|
||||
orders: rows as unknown as HttpTypes.AdminOrder[],
|
||||
count: metadata.count,
|
||||
offset: metadata.skip,
|
||||
limit: metadata.take,
|
||||
|
||||
@@ -5,10 +5,11 @@ import {
|
||||
} from "../../../../../types/routing"
|
||||
import { refetchPayment } from "../../helpers"
|
||||
import { AdminCreatePaymentCaptureType } from "../../validators"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<AdminCreatePaymentCaptureType>,
|
||||
res: MedusaResponse
|
||||
res: MedusaResponse<HttpTypes.AdminPaymentResponse>
|
||||
) => {
|
||||
const { id } = req.params
|
||||
|
||||
|
||||
@@ -5,10 +5,11 @@ import {
|
||||
} from "../../../../../types/routing"
|
||||
import { refetchPayment } from "../../helpers"
|
||||
import { AdminCreatePaymentRefundType } from "../../validators"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest<AdminCreatePaymentRefundType>,
|
||||
res: MedusaResponse
|
||||
res: MedusaResponse<HttpTypes.AdminPaymentResponse>
|
||||
) => {
|
||||
const { id } = req.params
|
||||
await refundPaymentWorkflow(req.scope).run({
|
||||
|
||||
@@ -4,10 +4,11 @@ import {
|
||||
} from "../../../../types/routing"
|
||||
import { AdminGetPaymentParamsType } from "../validators"
|
||||
import { refetchPayment } from "../helpers"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest<AdminGetPaymentParamsType>,
|
||||
res: MedusaResponse
|
||||
res: MedusaResponse<HttpTypes.AdminPaymentResponse>
|
||||
) => {
|
||||
const payment = await refetchPayment(
|
||||
req.params.id,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
@@ -10,7 +11,7 @@ import {
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest<AdminGetPaymentProvidersParamsType>,
|
||||
res: MedusaResponse
|
||||
res: MedusaResponse<HttpTypes.AdminPaymentProviderListResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
const queryObject = remoteQueryObjectFromString({
|
||||
|
||||
@@ -7,10 +7,11 @@ import {
|
||||
MedusaResponse,
|
||||
} from "../../../types/routing"
|
||||
import { AdminGetPaymentsParamsType } from "./validators"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest<AdminGetPaymentsParamsType>,
|
||||
res: MedusaResponse
|
||||
res: MedusaResponse<HttpTypes.AdminPaymentsResponse>
|
||||
) => {
|
||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
const queryObject = remoteQueryObjectFromString({
|
||||
|
||||
Reference in New Issue
Block a user