Add mass edit of visible, browsable and blacklisting (#86)
* Add massedit WIP * Add massedit * Review comments * Remove more debug
This commit is contained in:
@@ -416,4 +416,41 @@ export const productMutationTypeDefs = {
|
||||
);
|
||||
return (<ProductAPI>dataSources.productApi).getProduct(productId);
|
||||
},
|
||||
/**
|
||||
* @function massUpdatePublishing
|
||||
* @description Mutate the publishing for products
|
||||
*/
|
||||
async massUpdatePublishing(
|
||||
_,
|
||||
{ productIds, visible, browsable },
|
||||
{ dataSources, auth },
|
||||
) {
|
||||
checkAccess(['products.write'], auth);
|
||||
await (<ProductAPI>dataSources.productApi).massUpdatePublishing(
|
||||
productIds,
|
||||
visible,
|
||||
browsable,
|
||||
);
|
||||
return {
|
||||
value: 'OK',
|
||||
};
|
||||
},
|
||||
/**
|
||||
* @function massUpdateBlacklisting
|
||||
* @description Mutate the blacklisting for products
|
||||
*/
|
||||
async massUpdateBlacklisting(
|
||||
_,
|
||||
{ productIds, markets },
|
||||
{ dataSources, auth },
|
||||
) {
|
||||
checkAccess(['products.write'], auth);
|
||||
await (<ProductAPI>dataSources.productApi).massUpdateBlacklisting(
|
||||
productIds,
|
||||
markets,
|
||||
);
|
||||
return {
|
||||
value: 'OK',
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user