chore: Move customer + customer group integration tests and fixes issues (#7577)
* chore: Move customer + customer group and fixes issues * remove /customer sendpoint
This commit is contained in:
@@ -2,6 +2,7 @@ import {
|
||||
deleteCustomersWorkflow,
|
||||
updateCustomersWorkflow,
|
||||
} from "@medusajs/core-flows"
|
||||
import { AdminCustomer } from "@medusajs/types"
|
||||
import { MedusaError } from "@medusajs/utils"
|
||||
import {
|
||||
AuthenticatedMedusaRequest,
|
||||
@@ -9,7 +10,6 @@ import {
|
||||
} from "../../../../types/routing"
|
||||
import { refetchCustomer } from "../helpers"
|
||||
import { AdminUpdateCustomerType } from "../validators"
|
||||
import { AdminCustomer } from "@medusajs/types"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest,
|
||||
|
||||
@@ -13,8 +13,26 @@ export const defaultAdminCustomerFields = [
|
||||
"deleted_at",
|
||||
]
|
||||
|
||||
export const allowed = [
|
||||
"id",
|
||||
"company_name",
|
||||
"first_name",
|
||||
"last_name",
|
||||
"email",
|
||||
"phone",
|
||||
"metadata",
|
||||
"has_account",
|
||||
"created_by",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
"deleted_at",
|
||||
"addresses",
|
||||
"groups",
|
||||
]
|
||||
|
||||
export const retrieveTransformQueryConfig = {
|
||||
defaults: defaultAdminCustomerFields,
|
||||
allowed,
|
||||
isList: false,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { createCustomersWorkflow } from "@medusajs/core-flows"
|
||||
|
||||
import { AdminCustomer, PaginatedResponse } from "@medusajs/types"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
remoteQueryObjectFromString,
|
||||
@@ -8,9 +9,8 @@ import {
|
||||
AuthenticatedMedusaRequest,
|
||||
MedusaResponse,
|
||||
} from "../../../types/routing"
|
||||
import { AdminCreateCustomerType } from "./validators"
|
||||
import { refetchCustomer } from "./helpers"
|
||||
import { AdminCustomer, PaginatedResponse } from "@medusajs/types"
|
||||
import { AdminCreateCustomerType } from "./validators"
|
||||
|
||||
export const GET = async (
|
||||
req: AuthenticatedMedusaRequest,
|
||||
|
||||
Reference in New Issue
Block a user