79820239

Date: 2025-11-14 16:23:04
Score: 0.5
Natty:
Report link
  async afterCreate(event) {
    const { result } = event;
    const response = await axios.get(`http://127.0.0.1:8000/api/import/${result.GTIN}`);
    const product = response.data.products.product;
    strapi.log.info('Added', result.id);
    let updatedProduct = await strapi
    .documents('api::product.product')
    .update({
      documentId: result.documentId,
      data: {
        nutritional: await getNutrition(product)
      },
    });
  }

Easy solution. I have to call my saved data and set it direct in the database

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: ChissiMausi