Feat(medusa): search orders by customer phone and name (#2913)
* add support for customer first- and last names and phone * test for querying customer first_name, last_name and phone * add customer as prop for querying orders * polishing before pr * changeset
This commit is contained in:
@@ -220,6 +220,7 @@ class OrderService extends TransactionBaseService {
|
||||
alias: "order",
|
||||
innerJoin: {
|
||||
shipping_address: "order.shipping_address",
|
||||
customer: "order.customer",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -233,6 +234,9 @@ class OrderService extends TransactionBaseService {
|
||||
})
|
||||
.orWhere(`order.email ILIKE :q`, { q: `%${q}%` })
|
||||
.orWhere(`display_id::varchar(255) ILIKE :dId`, { dId: `${q}` })
|
||||
.orWhere(`customer.first_name ILIKE :q`, { q: `%${q}%` })
|
||||
.orWhere(`customer.last_name ILIKE :q`, { q: `%${q}%` })
|
||||
.orWhere(`customer.phone ILIKE :q`, { q: `%${q}%` })
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user