This commit is contained in:
Joshua T Flowers 2019-02-04 10:50:22 +08:00 committed by GitHub
parent a4f7fcdfe3
commit 2c1f8c17c7
1 changed files with 5 additions and 5 deletions

View File

@ -39,30 +39,30 @@ export function getRequestByIdString( path, handleData = identity ) {
} }
export const getCategoryLabels = getRequestByIdString( export const getCategoryLabels = getRequestByIdString(
NAMESPACE + 'products/categories', NAMESPACE + '/products/categories',
category => ( { category => ( {
id: category.id, id: category.id,
label: category.name, label: category.name,
} ) } )
); );
export const getCouponLabels = getRequestByIdString( NAMESPACE + 'coupons', coupon => ( { export const getCouponLabels = getRequestByIdString( NAMESPACE + '/coupons', coupon => ( {
id: coupon.id, id: coupon.id,
label: coupon.code, label: coupon.code,
} ) ); } ) );
export const getCustomerLabels = getRequestByIdString( NAMESPACE + 'customers', customer => ( { export const getCustomerLabels = getRequestByIdString( NAMESPACE + '/customers', customer => ( {
id: customer.id, id: customer.id,
label: customer.username, label: customer.username,
} ) ); } ) );
export const getProductLabels = getRequestByIdString( NAMESPACE + 'products', product => ( { export const getProductLabels = getRequestByIdString( NAMESPACE + '/products', product => ( {
id: product.id, id: product.id,
label: product.name, label: product.name,
} ) ); } ) );
export const getVariationLabels = getRequestByIdString( export const getVariationLabels = getRequestByIdString(
query => NAMESPACE + `products/${ query.products }/variations`, query => NAMESPACE + `/products/${ query.products }/variations`,
variation => { variation => {
return { return {
id: variation.id, id: variation.id,