Add prod from CMS (#111)

This commit is contained in:
Niklas Fondberg
2022-04-19 13:02:48 +02:00
committed by GitHub
parent 1afebfdfdb
commit 60d4d312f1
4 changed files with 11 additions and 3 deletions
+2 -1
View File
@@ -140,11 +140,12 @@ export const productMutationTypeDefs = {
* @function addProduct
* @description Will add a product
*/
async addProduct(_, { name, batch }, { dataSources, auth }) {
async addProduct(_, { name, batch, designerId }, { dataSources, auth }) {
checkAccess(['products.write'], auth);
const id = await (<ProductAPI>dataSources.productApi).addProduct(
name,
batch,
designerId,
);
return (<ProductAPI>dataSources.productApi).getProduct(id);
},