sr-npm 1.7.256 → 1.7.257

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/pages/homePage.js +31 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.256",
3
+ "version": "1.7.257",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/pages/homePage.js CHANGED
@@ -25,19 +25,43 @@ async function homePageOnReady(_$w,thisObject) {
25
25
  const numOfItems = await _$w('#citiesDataset').getTotalCount();
26
26
  const items = await _$w('#citiesDataset').getItems(0, numOfItems);
27
27
  let baseUrl = await location.baseUrl();
28
- const markers = items.items.map(item => {
28
+ // const markers = items.items.map(item => {
29
+ // const location = item.locationAddress.location;
30
+ // const cityName = encodeURIComponent(item.title); // Use the city name from the item
31
+ // const cityLinkUrl = `${baseUrl}/positions?location=${cityName}`; // Add city as search parameter
32
+ // return {
33
+ // location: {
34
+ // latitude: location.latitude,
35
+ // longitude: location.longitude
36
+ // },
37
+ // address: item.locationAddress.formatted,
38
+ // title: item.title,
39
+ // link: cityLinkUrl,
40
+ // linkTitle:`View ${item.count} Open Positions`
41
+ // };
42
+ // });
43
+ const markers = items.items
44
+ .filter(item => {
45
+ const locationAddress = item.locationAddress;
46
+ const location = locationAddress && locationAddress.location;
47
+ return (
48
+ location !== undefined &&
49
+ location !== null &&
50
+ location.latitude !== undefined &&
51
+ location.latitude !== null &&
52
+ location.longitude !== undefined &&
53
+ location.longitude !== null
54
+ );
55
+ })
56
+ .map(item => {
29
57
  const location = item.locationAddress.location;
30
- const cityName = encodeURIComponent(item.title); // Use the city name from the item
31
- const cityLinkUrl = `${baseUrl}/positions?location=${cityName}`; // Add city as search parameter
32
58
  return {
33
59
  location: {
34
60
  latitude: location.latitude,
35
61
  longitude: location.longitude
36
62
  },
37
- address: item.locationAddress.formatted,
38
- title: item.title,
39
- link: cityLinkUrl,
40
- linkTitle:`View ${item.count} Open Positions`
63
+ address: item.locationAddress.formatted,
64
+ title: item.title
41
65
  };
42
66
  });
43
67
  //@ts-ignore