Generate new interiors on focus point changes and break Cloudfront cache (#50)

* gen-new-interiors-on-focus-changes

* Remove 1 hour cache

* Cachebreak CDN
This commit is contained in:
Niklas Fondberg
2021-09-20 16:11:00 +02:00
committed by GitHub
parent ada116b787
commit 8845dd26d0
3 changed files with 10 additions and 2 deletions
+8
View File
@@ -101,6 +101,14 @@ export const productMutationTypeDefs = {
focusXpoint2,
focusYpoint2,
);
// generate new interiors
const product = await (<ProductAPI>dataSources.productApi).getProduct(
productId,
);
await (<InteriorsLambdaAPI>(
dataSources.interiorsLambdaApi
)).generateNewInteriors(product);
return (<ProductAPI>dataSources.productApi).getProduct(productId);
},
async productBlacklisting(_, { productId, markets }, { dataSources }) {