@salesforcedevs/dx-components 1.3.222-alpha10 → 1.3.222-alpha11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.3.222-alpha10",
3
+ "version": "1.3.222-alpha11",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -4,7 +4,7 @@ import { LightningElement, api } from "lwc";
4
4
  export default class CoveoRecommendations extends LightningElement {
5
5
  @api coveoAuthToken!: string;
6
6
 
7
- recommendations = [];
7
+ recommendations = [] as any[];
8
8
  recommendationsLoaded = false;
9
9
 
10
10
  connectedCallback() {
@@ -33,14 +33,13 @@ export default class CoveoRecommendations extends LightningElement {
33
33
  })
34
34
  }).then(async (response) => {
35
35
  const recommendations = (await response.json()).results;
36
- const blogPosts = recommendations.slice(0, 3).map(async (rec) => {
36
+ recommendations.slice(0, 3).forEach(async (rec: any) => {
37
37
  const slug = rec.uri.split("/").pop();
38
38
  const blogDataUrl = `https://developer.salesforce.com/blogs/wp-json/wp/v2/posts?slug=${slug}&state=publish&_embed=wp:featuredmedia`;
39
39
  const blogData = (await (await fetch(blogDataUrl)).json())[0];
40
40
  console.log(blogData);
41
- return blogData;
41
+ this.recommendations.push(blogData);
42
42
  });
43
- this.recommendations = blogPosts;
44
43
  this.recommendationsLoaded = true;
45
44
  });
46
45
  }