20: printproduct group mutation (#21)
* Finished the mutation for productGroups * Fixes after CR * added enums for typeid
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { ProductAPI } from '../datasources/product-api';
|
||||
import {
|
||||
Product,
|
||||
ProductGroup,
|
||||
ProductListResult,
|
||||
ProductsFilterInput,
|
||||
} from '../types/product-types';
|
||||
@@ -94,6 +95,13 @@ export const productMutationTypeDefs = {
|
||||
);
|
||||
return (<ProductAPI>dataSources.productApi).getProduct(productId);
|
||||
},
|
||||
async productGroup(_, { productId, groupIds }, { dataSources }) {
|
||||
await (<ProductAPI>dataSources.productApi).updateGroups(
|
||||
productId,
|
||||
groupIds,
|
||||
);
|
||||
return (<ProductAPI>dataSources.productApi).getProduct(productId);
|
||||
},
|
||||
async productKeywords(_, { productId, keywordIds }, { dataSources }) {
|
||||
await (<KeywordAPI>dataSources.keywordApi).setProductKeywords(
|
||||
productId,
|
||||
|
||||
Reference in New Issue
Block a user