feat: customer groups react hooks (#1153)
* fix: msw handlers for medusa-react storybook * feat: add customer groups query hooks * feat: add create/update customer groups hooks * feat: add customer group batch hooks * feat: add test files, fix import * add customer groups fixture * add customer gorup mock endpoints * add test cases * add hook comments * fix: typos * fix: comments refactor * fix: comment Co-authored-by: fPolic <frane@medusajs.com>
This commit is contained in:
@@ -17,7 +17,7 @@ class AdminCustomerGroupsResource extends BaseResource {
|
||||
/**
|
||||
* Create a customer group.
|
||||
*
|
||||
* @param payload - Customer group info.
|
||||
* @param payload - customer group info
|
||||
* @param customHeaders
|
||||
*/
|
||||
create(
|
||||
@@ -44,8 +44,8 @@ class AdminCustomerGroupsResource extends BaseResource {
|
||||
/**
|
||||
* Updates a customer group
|
||||
*
|
||||
* @param id customer group id
|
||||
* @param payload data to update customer group with
|
||||
* @param id - customer group id
|
||||
* @param payload - data to update customer group with
|
||||
* @param customHeaders
|
||||
*/
|
||||
update(
|
||||
@@ -102,7 +102,7 @@ class AdminCustomerGroupsResource extends BaseResource {
|
||||
id: string,
|
||||
payload: AdminPostCustomerGroupsGroupCustomersBatchReq,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): Promise<AdminCustomerGroupsRes> {
|
||||
): ResponsePromise<AdminCustomerGroupsRes> {
|
||||
const path = `/admin/customer-groups/${id}/customers/batch`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
@@ -118,7 +118,7 @@ class AdminCustomerGroupsResource extends BaseResource {
|
||||
id: string,
|
||||
payload: AdminDeleteCustomerGroupsGroupCustomerBatchReq,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): Promise<AdminCustomerGroupsRes> {
|
||||
): ResponsePromise<AdminCustomerGroupsRes> {
|
||||
const path = `/admin/customer-groups/${id}/customers/batch`
|
||||
return this.client.request("DELETE", path, payload, {}, customHeaders)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user