@abcagency/hc-ui-components 1.3.18 → 1.3.20

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 (190) hide show
  1. package/dist/apis/hcApi.js +85 -183
  2. package/dist/apis/hcApi.js.map +1 -1
  3. package/dist/components/HireControlMap.js +10 -5
  4. package/dist/components/HireControlMap.js.map +1 -1
  5. package/dist/components/modules/accordions/MapAccordionItem.js +10 -67
  6. package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
  7. package/dist/components/modules/filter/index.js.map +1 -1
  8. package/dist/components/modules/filter/radio-item.js +1 -2
  9. package/dist/components/modules/filter/radio-item.js.map +1 -1
  10. package/dist/components/modules/jobListing/listing-details-container.js +45 -0
  11. package/dist/components/modules/jobListing/listing-details-container.js.map +1 -0
  12. package/dist/components/modules/jobListing/listing-details.js +25 -24
  13. package/dist/components/modules/jobListing/listing-details.js.map +1 -1
  14. package/dist/components/modules/{maps/list → list}/field-mapper.js +8 -7
  15. package/dist/components/modules/list/field-mapper.js.map +1 -0
  16. package/dist/components/modules/{maps/list → list}/header-item.js +2 -2
  17. package/dist/components/modules/list/header-item.js.map +1 -0
  18. package/dist/components/modules/{maps/list → list}/header.js +6 -4
  19. package/dist/components/modules/list/header.js.map +1 -0
  20. package/dist/components/modules/list/index.js +36 -0
  21. package/dist/components/modules/list/index.js.map +1 -0
  22. package/dist/components/modules/{maps/list → list}/item-expand-card/index.js +3 -1
  23. package/dist/components/modules/list/item-expand-card/index.js.map +1 -0
  24. package/dist/components/modules/{maps/list → list}/item-expand-card/recruiter-contact-nav.js +2 -2
  25. package/dist/components/modules/list/item-expand-card/recruiter-contact-nav.js.map +1 -0
  26. package/dist/components/modules/{maps/list → list}/item-expand-card/recruiter-details.js +1 -1
  27. package/dist/components/modules/list/item-expand-card/recruiter-details.js.map +1 -0
  28. package/dist/components/modules/list/item-expand-card/recruiter-headshot.js.map +1 -0
  29. package/dist/components/modules/list/item-list.js +131 -0
  30. package/dist/components/modules/list/item-list.js.map +1 -0
  31. package/dist/components/modules/list/list-item/index.js +75 -0
  32. package/dist/components/modules/list/list-item/index.js.map +1 -0
  33. package/dist/components/modules/list/list-item/list-item-container.js +47 -0
  34. package/dist/components/modules/list/list-item/list-item-container.js.map +1 -0
  35. package/dist/components/modules/{maps/list/list-item/index.js → list/list-item/list-item.js} +29 -33
  36. package/dist/components/modules/list/list-item/list-item.js.map +1 -0
  37. package/dist/components/modules/maps/map-list.js +3 -3
  38. package/dist/components/modules/maps/map-list.js.map +1 -1
  39. package/dist/contexts/mapContext.js +84 -113
  40. package/dist/contexts/mapContext.js.map +1 -1
  41. package/dist/contexts/mapListContext.js +181 -293
  42. package/dist/contexts/mapListContext.js.map +1 -1
  43. package/dist/contexts/trackEventContext.js +1 -1
  44. package/dist/services/configService.js +10 -28
  45. package/dist/services/configService.js.map +1 -1
  46. package/dist/services/googlePlacesNearbyService.js +33 -58
  47. package/dist/services/googlePlacesNearbyService.js.map +1 -1
  48. package/dist/services/listingAggregatorService.js +35 -75
  49. package/dist/services/listingAggregatorService.js.map +1 -1
  50. package/dist/services/listingEntityService.js +10 -31
  51. package/dist/services/listingEntityService.js.map +1 -1
  52. package/dist/services/listingService.js +26 -60
  53. package/dist/services/listingService.js.map +1 -1
  54. package/dist/services/recruiterService.js +11 -31
  55. package/dist/services/recruiterService.js.map +1 -1
  56. package/dist/types/apis/hcApi.d.ts +5 -0
  57. package/dist/types/clientToken.d.ts +2 -0
  58. package/dist/types/components/modules/accordions/MapAccordionItem.d.ts +9 -0
  59. package/dist/types/components/modules/accordions/default.d.ts +19 -0
  60. package/dist/types/components/modules/buttons/button-group-apply.d.ts +24 -0
  61. package/dist/types/components/modules/buttons/commute-pill.d.ts +5 -0
  62. package/dist/types/components/modules/buttons/default.d.ts +48 -0
  63. package/dist/types/components/modules/buttons/pill-wrapper.d.ts +3 -0
  64. package/dist/types/components/modules/dialogs/apply-dialog.d.ts +8 -0
  65. package/dist/types/components/modules/filter/sort.d.ts +8 -0
  66. package/dist/types/components/modules/grid.d.ts +8 -0
  67. package/dist/types/components/modules/icon.d.ts +10 -0
  68. package/dist/types/components/modules/jobListing/listing-details-container.d.ts +6 -0
  69. package/dist/types/components/modules/jobListing/listing-details.d.ts +18 -0
  70. package/dist/types/components/modules/list/field-mapper.d.ts +10 -0
  71. package/dist/types/components/modules/list/header-item.d.ts +11 -0
  72. package/dist/types/components/modules/list/header.d.ts +11 -0
  73. package/dist/types/components/modules/list/index.d.ts +9 -0
  74. package/dist/types/components/modules/list/item-expand-card/index.d.ts +7 -0
  75. package/dist/types/components/modules/list/item-expand-card/recruiter-contact-nav.d.ts +17 -0
  76. package/dist/types/components/modules/list/item-expand-card/recruiter-details.d.ts +21 -0
  77. package/dist/types/components/modules/list/item-expand-card/recruiter-headshot.d.ts +8 -0
  78. package/dist/types/components/modules/list/item-list.d.ts +21 -0
  79. package/dist/types/components/modules/list/list-item/index.d.ts +12 -0
  80. package/dist/types/components/modules/list/list-item/list-item-container.d.ts +14 -0
  81. package/dist/types/components/modules/list/list-item/list-item.d.ts +3 -0
  82. package/dist/types/constants/eventTypes.d.ts +13 -0
  83. package/dist/types/contexts/mapContext.d.ts +29 -0
  84. package/dist/types/contexts/mapListContext.d.ts +58 -0
  85. package/dist/types/contexts/trackEventContext.d.ts +6 -0
  86. package/dist/types/enums/SectionType.d.ts +9 -0
  87. package/dist/types/hooks/useList.d.ts +13 -0
  88. package/dist/types/services/configService.d.ts +6 -0
  89. package/dist/types/services/googlePlacesNearbyService.d.ts +5 -0
  90. package/dist/types/services/listingAggregatorService.d.ts +12 -0
  91. package/dist/types/services/listingEntityService.d.ts +6 -0
  92. package/dist/types/services/listingService.d.ts +9 -0
  93. package/dist/types/services/recruiterService.d.ts +6 -0
  94. package/dist/types/types/Address.d.ts +7 -0
  95. package/dist/types/types/ContentSection.d.ts +8 -0
  96. package/dist/types/types/GetListingParams.d.ts +8 -0
  97. package/dist/types/types/LatLng.d.ts +4 -0
  98. package/dist/types/types/ListingEntity.d.ts +10 -0
  99. package/dist/types/types/ListingFields.d.ts +20 -0
  100. package/dist/types/types/Listings.d.ts +31 -0
  101. package/dist/types/types/Recruiter.d.ts +9 -0
  102. package/dist/types/types/SimilarListing.d.ts +24 -0
  103. package/dist/types/types/config/Colors.d.ts +8 -0
  104. package/dist/types/types/config/MapConfig.d.ts +29 -0
  105. package/dist/types/types/config/PointsOfInterestConfig.d.ts +13 -0
  106. package/dist/types/types/config/SearchConfig.d.ts +4 -0
  107. package/dist/types/util/filterUtil.d.ts +28 -0
  108. package/dist/types/util/loading.d.ts +3 -0
  109. package/dist/types/util/localStorageUtil.d.ts +3 -0
  110. package/dist/types/util/mapUtil.d.ts +15 -0
  111. package/dist/types/util/sortUtil.d.ts +1 -0
  112. package/dist/types/util/stringUtils.d.ts +1 -0
  113. package/dist/util/filterUtil.js +1 -3
  114. package/dist/util/filterUtil.js.map +1 -1
  115. package/dist/util/localStorageUtil.js +37 -28
  116. package/dist/util/localStorageUtil.js.map +1 -1
  117. package/dist/util/mapUtil.js.map +1 -1
  118. package/package.json +23 -17
  119. package/rollup.config.mjs +23 -19
  120. package/src/apis/{hcApi.js → hcApi.ts} +27 -11
  121. package/src/components/HireControlMap.js +132 -129
  122. package/src/components/modules/accordions/MapAccordionItem.js +32 -74
  123. package/src/components/modules/filter/index.js +89 -89
  124. package/src/components/modules/filter/radio-item.js +0 -1
  125. package/src/components/modules/jobListing/listing-details-container.js +40 -0
  126. package/src/components/modules/jobListing/listing-details.js +209 -99
  127. package/src/components/modules/{maps/list → list}/field-mapper.js +114 -112
  128. package/src/components/modules/{maps/list → list}/header.js +49 -47
  129. package/src/components/modules/list/index.tsx +83 -0
  130. package/src/components/modules/{maps/list → list}/item-expand-card/index.js +24 -22
  131. package/src/components/modules/list/item-list.tsx +198 -0
  132. package/src/components/modules/list/list-item/index.js +70 -0
  133. package/src/components/modules/list/list-item/list-item-container.js +43 -0
  134. package/src/components/modules/{maps/list/list-item/index.js → list/list-item/list-item.js} +32 -38
  135. package/src/components/modules/maps/map-list.js +74 -74
  136. package/src/contexts/mapContext.tsx +129 -0
  137. package/src/contexts/mapListContext.tsx +297 -0
  138. package/src/enums/SectionType.ts +9 -0
  139. package/src/services/{configService.js → configService.ts} +16 -16
  140. package/src/services/{googlePlacesNearbyService.js → googlePlacesNearbyService.ts} +11 -2
  141. package/src/services/listingAggregatorService.ts +76 -0
  142. package/src/services/listingEntityService.ts +16 -0
  143. package/src/services/listingService.ts +40 -0
  144. package/src/services/{recruiterService.js → recruiterService.ts} +18 -17
  145. package/src/types/Address.ts +7 -0
  146. package/src/types/ContentSection.ts +9 -0
  147. package/src/types/GetListingParams.ts +8 -0
  148. package/src/types/LatLng.ts +4 -0
  149. package/src/types/ListingEntity.ts +11 -0
  150. package/src/types/ListingFields.ts +20 -0
  151. package/src/types/Listings.ts +32 -0
  152. package/src/types/Recruiter.ts +9 -0
  153. package/src/types/SimilarListing.ts +24 -0
  154. package/src/types/config/Colors.ts +8 -0
  155. package/src/types/config/MapConfig.ts +30 -0
  156. package/src/types/config/PointsOfInterestConfig.ts +13 -0
  157. package/src/types/config/SearchConfig.ts +4 -0
  158. package/src/util/filterUtil.js +239 -239
  159. package/src/util/localStorageUtil.ts +34 -0
  160. package/src/util/mapUtil.js +91 -91
  161. package/tsconfig.json +23 -0
  162. package/dist/components/modules/maps/list/field-mapper.js.map +0 -1
  163. package/dist/components/modules/maps/list/header-item.js.map +0 -1
  164. package/dist/components/modules/maps/list/header.js.map +0 -1
  165. package/dist/components/modules/maps/list/index.js +0 -102
  166. package/dist/components/modules/maps/list/index.js.map +0 -1
  167. package/dist/components/modules/maps/list/item-expand-card/index.js.map +0 -1
  168. package/dist/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js.map +0 -1
  169. package/dist/components/modules/maps/list/item-expand-card/recruiter-details.js.map +0 -1
  170. package/dist/components/modules/maps/list/item-expand-card/recruiter-headshot.js.map +0 -1
  171. package/dist/components/modules/maps/list/list-item/index.js.map +0 -1
  172. package/dist/services/_virtual/_rollupPluginBabelHelpers.js +0 -372
  173. package/dist/services/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
  174. package/dist/services/apis/hcApi.js +0 -189
  175. package/dist/services/apis/hcApi.js.map +0 -1
  176. package/dist/services/clientToken.js +0 -7
  177. package/dist/services/clientToken.js.map +0 -1
  178. package/dist/services/styles/index.css +0 -3
  179. package/src/components/modules/maps/list/index.js +0 -112
  180. package/src/contexts/mapContext.js +0 -101
  181. package/src/contexts/mapListContext.js +0 -242
  182. package/src/services/listingAggregatorService.js +0 -50
  183. package/src/services/listingEntityService.js +0 -15
  184. package/src/services/listingService.js +0 -26
  185. package/src/util/localStorageUtil.js +0 -27
  186. /package/dist/components/modules/{maps/list → list}/item-expand-card/recruiter-headshot.js +0 -0
  187. /package/src/components/modules/{maps/list → list}/header-item.js +0 -0
  188. /package/src/components/modules/{maps/list → list}/item-expand-card/recruiter-contact-nav.js +0 -0
  189. /package/src/components/modules/{maps/list → list}/item-expand-card/recruiter-details.js +0 -0
  190. /package/src/components/modules/{maps/list → list}/item-expand-card/recruiter-headshot.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"mapListContext.js","sources":["../../src/contexts/mapListContext.js"],"sourcesContent":["import React, { createContext, useState, useEffect, useContext } from 'react';\n\nimport { generateFilterOptions, applyFilters, filterListingsByLocation } from '~/util/filterUtil';\nimport { getStorageObject, setStorageObject } from '~/util/localStorageUtil';\n\nimport { getListingEntities } from \"~/services/listingEntityService\";\nimport fetchListings from '~/services/listingAggregatorService';\n\nconst MapListContext = createContext();\n\nexport const useMapList = () => useContext(MapListContext);\n\nconst getQuery = () => {\n\tlet query;\n\t//if (!hasQueryInUrl(location)) {\n\tquery = typeof window !== 'undefined' ? localStorage.getItem('query') : '';\n\t// }\n\t//else {\n\t// \tquery = filtersFromURL(location).query;\n\t// }\n\treturn query;\n};\n\nexport const MapListProvider = ({\n\tchildren,\n\tsiteConfig,\n\tresetFilters,\n\tnavigateToDetails,\n\tnavigateToEasyApply,\n\tLink,\n\tlinkFormat,\n\ttrackEvent\n}) => {\n\t// const location = useLocation();\n\t// const navigate = useNavigate();\n\tconst [allListings, setAllListings] = useState(getStorageObject(\"listings\", []));\n\tconst [filteredListings, setFilteredListings] = useState([]);\n\tconst [loading, setLoading] = useState(false);\n\tconst [mapItems, setMapItems] = useState(getStorageObject('mapItems', []));\n\tconst [query, setQuery] = useState(() => resetFilters ? null : getQuery());\n\tconst [sortSetting, setSortSetting] = useState(getStorageObject('sortSetting', { field: 'position', type: 'asc' }));\n\tconst [listingEntities, setListingEntities] = useState(getStorageObject(\"listingEntities\", null));\n\tconst [firstLoad, setFirstLoad] = useState(true);\n\tconst [commuteLocation, setCommuteLocation] = useState(getStorageObject('commuteLocation'));\n\tconst [selectedFilters, setSelectedFilters] = useState(() => resetFilters ? {} : getStorageObject('selectedFilters', {}));//hasFiltersInURL(location) ? filtersFromURL(location).filters : getStorageObject('selectedFilters', {}));\n\tconst [filterOptions, setFilterOptions] = useState();\n\tconst [recruiters, setRecruiters] = useState(getStorageObject(\"recruiters\", {}));\n\tconst [filterDialogIsOpen, setFilterDialogIsOpen] = useState(false);\n\tconst [mobileTab, setMobileTab] = useState(\"listTab\");\n\tconst [favorites, setFavorites] = useState([]);\n\tconst [filterByFavorites, setFilterByFavorites] = useState(false);\n\n\tconst setNewFilteredListings = filteredListings =>{\n\t\tsetFilteredListings(filteredListings);\n\t};\n\n\tuseEffect(() => {\n\t\tif (!sortSetting) return;\n\t\tlocalStorage.setItem('sortSetting', JSON.stringify(sortSetting));\n\t\tsetNewFilteredListings(filteredListings);\n\t}, [sortSetting]);\n\n\tuseEffect(() => {\n\t\tconst loadedFavorites = JSON.parse(localStorage.getItem('favorites')) || [];\n\t\tsetFavorites(loadedFavorites);\n\t}, []);\n\n\tuseEffect(() => {\n\t\tsetStorageObject(\"commuteLocation\", commuteLocation);\n\t}, [commuteLocation]);\n\n\tuseEffect(() => {\n\t\tif (commuteLocation === null || commuteLocation === '') return;\n\t\tasync function fetchEntities() {\n\t\t\tconst distinctEntityIds = [\n\t\t\t\t// eslint-disable-next-line no-undef\n\t\t\t\t...new Set(allListings.map(listing => listing.entityId))\n\t\t\t];\n\t\t\ttry {\n\t\t\t\tconst fetchedEntities = await getListingEntities(\n\t\t\t\t\tdistinctEntityIds,\n\t\t\t\t\t`${commuteLocation.lat}, ${commuteLocation.lng}`\n\t\t\t\t);\n\t\t\t\tsetListingEntities(fetchedEntities);\n\t\t\t\tvar newFilteredListings = filteredListings;\n\t\t\t\tfor (var i = 0; i < allListings.length; i++) {\n\t\t\t\t\tif (newFilteredListings[i].entityId != -1) {\n\t\t\t\t\t\tnewFilteredListings[i].fields.travelTime = fetchedEntities[newFilteredListings[i].entityId].travelTime;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (var j = 0; j < newFilteredListings.length; j++) {\n\t\t\t\t\tif (newFilteredListings[j].entityId != -1) {\n\t\t\t\t\t\tnewFilteredListings[j].fields.travelTime = fetchedEntities[newFilteredListings[j].entityId].travelTime;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsetNewFilteredListings(newFilteredListings);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(\"Failed to fetch listing entities:\", error);\n\t\t\t}\n\t\t}\n\n\t\tfetchEntities();\n\t}, [commuteLocation, allListings, siteConfig.companyId]);\n\n\tuseEffect(() => {\n\t\tconst handleFetchListings = async () => {\n\t\t\tif (!getStorageObject('listings', []).length > 0) {\n\t\t\t\tsetLoading(true);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst {\n\t\t\t\t\tlistingsResult,\n\t\t\t\t\tfetchedRecruiters,\n\t\t\t\t\tfetchedEntities,\n\t\t\t\t\tdistinctItems\n\t\t\t\t} = await fetchListings(query, siteConfig, commuteLocation);\n\t\t\t\tsetAllListings(listingsResult);\n\t\t\t\tsetRecruiters(fetchedRecruiters);\n\t\t\t\tsetListingEntities(fetchedEntities);\n\t\t\t\tsetMapItems(distinctItems);\n\t\t\t\tsetStorageObject(\"mapItems\", distinctItems);\n\t\t\t\tsetStorageObject(\"listingEntities\", fetchedEntities);\n\t\t\t\tsetStorageObject(\"recruiters\", fetchedRecruiters);\n\t\t\t\tsetStorageObject(\"listings\", listingsResult);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\tsetLoading(false);\n\t\t};\n\t\thandleFetchListings();\n\t}, [query, siteConfig]);\n\n\tuseEffect(() => {\n\t\tconst processListings = () => {\n\t\t\tlet { filteredListings, mapItems } = applyFilters(\n\t\t\t\tallListings,\n\t\t\t\tselectedFilters,\n\t\t\t\tquery,\n\t\t\t\tlistingEntities,\n\t\t\t\tfavorites,\n\t\t\t\tsiteConfig\n\t\t\t);\n\t\t\tif (filterByFavorites) {\n\t\t\t\tfilteredListings = filteredListings.filter(x => favorites.includes(x.id));\n\t\t\t}\n\t\t\tsetNewFilteredListings(filteredListings);\n\t\t\t// if (firstLoad && hasFiltersInURL(location)) {\n\t\t\t// \tconst { filters } = filtersFromURL(location);\n\t\t\t// \tsetSelectedFilters(filters);\n\t\t\t// }\n\t\t\tif (firstLoad && selectedFilters) {\n\t\t\t\t//updateURLWithFilters(selectedFilters,location, navigate, query);\n\t\t\t} else if (Object.keys(selectedFilters).length === 0 && !firstLoad) {\n\t\t\t\tlocalStorage.removeItem('selectedFilters');\n\t\t\t\t//updateURLWithFilters(selectedFilters,location, navigate, query);\n\t\t\t} else if (!firstLoad) {\n\t\t\t\tsetStorageObject('selectedFilters', selectedFilters);\n\t\t\t\t//updateURLWithFilters(selectedFilters,location, navigate, query);\n\t\t\t}\n\t\t\tquery != null ? localStorage.setItem('query', query) : localStorage.removeItem('query');\n\t\t\tsetMapItems(mapItems);\n\n\t\t\tif (selectedFilters) {\n\t\t\t\tconst keys = Object.keys(selectedFilters);\n\t\t\t\tconst lastKey = keys[keys.length - 1];\n\t\t\t\tconst options = generateFilterOptions(\n\t\t\t\t\tfirstLoad ? allListings : filteredListings,\n\t\t\t\t\tallListings,\n\t\t\t\t\tsiteConfig,\n\t\t\t\t\tfilterOptions,\n\t\t\t\t\tlastKey,\n\t\t\t\t\tfavorites\n\t\t\t\t);\n\t\t\t\tif (options) {\n\t\t\t\t\tsetFilterOptions(options);\n\t\t\t\t\tif (firstLoad) setFirstLoad(false);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tprocessListings();\n\t}, [selectedFilters, query, listingEntities, filterByFavorites, favorites]);\n\n\tconst handleFilterListingsByLocation = selectedLocation => {\n\t\tlet { filteredListings } = filterListingsByLocation(\n\t\t\tallListings,\n\t\t\tselectedLocation,\n\t\t\tlistingEntities\n\t\t);\n\n\t\tsetNewFilteredListings(filteredListings);\n\t\t//setMapItems(mapItems);\n\t};\n\n\tconst handleSettingFavorites = newFavorites => {\n\t\tif (newFavorites == null) {\n\t\t\tlocalStorage.removeItem('favorites');\n\t\t} else {\n\t\t\tsetFavorites(newFavorites);\n\t\t\tlocalStorage.setItem('favorites', JSON.stringify(newFavorites));\n\t\t}\n\t};\n\n\treturn (\n\t\t<MapListContext.Provider value={{\n\t\t\tloading,\n\t\t\tallListings,\n\t\t\tfilteredListings,\n\t\t\tmapItems,\n\t\t\tquery,\n\t\t\tsetNewFilteredListings,\n\t\t\tsetQuery,\n\t\t\tlistingEntities,\n\t\t\tselectedFilters,\n\t\t\tsetSelectedFilters,\n\t\t\tfilterOptions,\n\t\t\trecruiters,\n\t\t\thandleFilterListingsByLocation,\n\t\t\tfilterDialogIsOpen,\n\t\t\tsetFilterDialogIsOpen,\n\t\t\tsetMobileTab,\n\t\t\tmobileTab,\n\t\t\tsiteConfig,\n\t\t\tfavorites,\n\t\t\thandleSettingFavorites,\n\t\t\tsetFilterByFavorites,\n\t\t\tfilterByFavorites,\n\t\t\tcommuteLocation,\n\t\t\tsetCommuteLocation,\n\t\t\tnavigateToDetails,\n\t\t\tnavigateToEasyApply,\n\t\t\tLink,\n\t\t\tlinkFormat,\n\t\t\tsortSetting,\n\t\t\tsetSortSetting,\n\t\t\ttrackEvent\n\t\t}}>\n\t\t\t{children}\n\t\t</MapListContext.Provider>\n\t);\n};\n"],"names":["MapListContext","createContext","useMapList","useContext","getQuery","query","window","localStorage","getItem","MapListProvider","_ref","children","siteConfig","resetFilters","navigateToDetails","navigateToEasyApply","Link","linkFormat","trackEvent","_useState","useState","getStorageObject","_useState2","_slicedToArray","allListings","setAllListings","_useState3","_useState4","filteredListings","setFilteredListings","_useState5","_useState6","loading","setLoading","_useState7","_useState8","mapItems","setMapItems","_useState9","_useState10","setQuery","_useState11","field","type","_useState12","sortSetting","setSortSetting","_useState13","_useState14","listingEntities","setListingEntities","_useState15","_useState16","firstLoad","setFirstLoad","_useState17","_useState18","commuteLocation","setCommuteLocation","_useState19","_useState20","selectedFilters","setSelectedFilters","_useState21","_useState22","filterOptions","setFilterOptions","_useState23","_useState24","recruiters","setRecruiters","_useState25","_useState26","filterDialogIsOpen","setFilterDialogIsOpen","_useState27","_useState28","mobileTab","setMobileTab","_useState29","_useState30","favorites","setFavorites","_useState31","_useState32","filterByFavorites","setFilterByFavorites","setNewFilteredListings","useEffect","setItem","JSON","stringify","loadedFavorites","parse","setStorageObject","fetchEntities","_fetchEntities","apply","arguments","_asyncToGenerator","_regeneratorRuntime","mark","_callee","distinctEntityIds","fetchedEntities","newFilteredListings","i","j","wrap","_callee$","_context","prev","next","_toConsumableArray","Set","map","listing","entityId","getListingEntities","concat","lat","lng","sent","length","fields","travelTime","t0","console","error","stop","companyId","handleFetchListings","_ref2","_callee2","_yield$fetchListings","listingsResult","fetchedRecruiters","distinctItems","_callee2$","_context2","fetchListings","log","processListings","_applyFilters","applyFilters","filter","x","includes","id","Object","keys","removeItem","lastKey","options","generateFilterOptions","handleFilterListingsByLocation","selectedLocation","_filterListingsByLoca","filterListingsByLocation","handleSettingFavorites","newFavorites","React","createElement","Provider","value"],"mappings":";;;;;;;AAQA,IAAMA,cAAc,gBAA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MAAAA,eAAe,EAAfA,eAAe;AACfC,MAAAA,kBAAkB,EAAlBA,kBAAkB;AAClBG,MAAAA,aAAa,EAAbA,aAAa;AACbI,MAAAA,UAAU,EAAVA,UAAU;AACVsF,MAAAA,8BAA8B,EAA9BA,8BAA8B;AAC9BlF,MAAAA,kBAAkB,EAAlBA,kBAAkB;AAClBC,MAAAA,qBAAqB,EAArBA,qBAAqB;AACrBI,MAAAA,YAAY,EAAZA,YAAY;AACZD,MAAAA,SAAS,EAATA,SAAS;AACTjE,MAAAA,UAAU,EAAVA,UAAU;AACVqE,MAAAA,SAAS,EAATA,SAAS;AACT8E,MAAAA,sBAAsB,EAAtBA,sBAAsB;AACtBzE,MAAAA,oBAAoB,EAApBA,oBAAoB;AACpBD,MAAAA,iBAAiB,EAAjBA,iBAAiB;AACjB5B,MAAAA,eAAe,EAAfA,eAAe;AACfC,MAAAA,kBAAkB,EAAlBA,kBAAkB;AAClB5C,MAAAA,iBAAiB,EAAjBA,iBAAiB;AACjBC,MAAAA,mBAAmB,EAAnBA,mBAAmB;AACnBC,MAAAA,IAAI,EAAJA,IAAI;AACJC,MAAAA,UAAU,EAAVA,UAAU;AACV4B,MAAAA,WAAW,EAAXA,WAAW;AACXC,MAAAA,cAAc,EAAdA,cAAc;AACd5B,MAAAA,UAAU,EAAVA,UAAAA;AACD,KAAA;AAAE,GAAA,EACAP,QACuB,CAAC,CAAA;AAE5B;;;;"}
1
+ {"version":3,"file":"mapListContext.js","sources":["../../src/contexts/mapListContext.tsx"],"sourcesContent":["import React, { createContext, useState, useEffect, useContext, ReactNode } from 'react';\n\nimport { generateFilterOptions, applyFilters, filterListingsByLocation } from '~/util/filterUtil';\nimport { getStorageObject, setStorageObject } from '~/util/localStorageUtil';\n\nimport { getListingEntities } from \"~/services/listingEntityService\";\nimport fetchListings from '~/services/listingAggregatorService';\n\nimport { Listing } from '~/types/Listings';\nimport { ListingEntity } from '~/types/ListingEntity';\nimport { Recruiter } from '~/types/Recruiter';\nimport { MapConfig, MapConfig as SiteConfig } from '~/types/config/MapConfig';\n\ninterface MapListContextProps {\n loading: boolean;\n allListings: Listing[];\n filteredListings: Listing[];\n mapItems: any;\n query: string | null;\n setNewFilteredListings: (filteredListings: Listing[]) => void;\n setQuery: (query: string | null) => void;\n listingEntities: Record<number, ListingEntity> | null;\n selectedFilters: Record<string, any>;\n setSelectedFilters: (filters: Record<string, any>) => void;\n filterOptions: any;\n recruiters: Record<number, Recruiter>;\n handleFilterListingsByLocation: (selectedLocation: any) => void;\n filterDialogIsOpen: boolean;\n setFilterDialogIsOpen: (isOpen: boolean) => void;\n setMobileTab: (tab: string) => void;\n mobileTab: string;\n siteConfig: SiteConfig;\n favorites: number[];\n handleSettingFavorites: (favorites: number[] | null) => void;\n setFilterByFavorites: (filter: boolean) => void;\n filterByFavorites: boolean;\n commuteLocation: any | null;\n setCommuteLocation: (location: any | null) => void;\n navigateToDetails: (id: number) => void;\n navigateToEasyApply: (id: number) => void;\n Link: React.ComponentType<any>;\n linkFormat: string;\n sortSetting: { field: string; type: string };\n setSortSetting: (setting: { field: string; type: string }) => void;\n trackEvent: (event: string) => void;\n}\n\nconst MapListContext = createContext<MapListContextProps | undefined>(undefined);\n\nexport const useMapList = () => {\n\tconst context = useContext(MapListContext);\n\tif (!context) {\n\t\tthrow new Error('useMapList must be used within a MapListProvider');\n\t}\n\treturn context;\n};\n\nconst getQuery = (): string | null => {\n\tlet query: string | null = null;\n\tif (typeof window !== 'undefined') {\n\t\tquery = localStorage.getItem('query');\n\t}\n\treturn query;\n};\n\ninterface MapListProviderProps {\n children: ReactNode;\n siteConfig: MapConfig;\n resetFilters: boolean;\n navigateToDetails: (id: number) => void;\n navigateToEasyApply: (id: number) => void;\n Link: React.ComponentType<any>;\n linkFormat: string;\n trackEvent: (event: string) => void;\n listings?: Listing[];\n}\n\nexport const MapListProvider: React.FC<MapListProviderProps> = ({\n\tchildren,\n\tsiteConfig,\n\tresetFilters,\n\tnavigateToDetails,\n\tnavigateToEasyApply,\n\tLink,\n\tlinkFormat,\n\ttrackEvent,\n\tlistings = []\n}) => {\n\tconst [allListings, setAllListings] = useState<Listing[]>(getStorageObject(\"listings\", listings) || []);\n\tconst [filteredListings, setFilteredListings] = useState<Listing[]>([]);\n\tconst [loading, setLoading] = useState<boolean>(false);\n\tconst [mapItems, setMapItems] = useState<any>(getStorageObject('mapItems', []) || []);\n\tconst [query, setQuery] = useState<string | null>(() => resetFilters ? null : getQuery());\n\tconst [sortSetting, setSortSetting] = useState<{ field: string; type: string }>(getStorageObject('sortSetting', { field: 'position', type: 'asc' }) || { field: 'position', type: 'asc' });\n\tconst [listingEntities, setListingEntities] = useState<Record<number, ListingEntity> | null>(getStorageObject(\"listingEntities\", null));\n\tconst [firstLoad, setFirstLoad] = useState<boolean>(true);\n\tconst [commuteLocation, setCommuteLocation] = useState<any | null>(getStorageObject('commuteLocation'));\n\tconst [selectedFilters, setSelectedFilters] = useState<Record<string, any>>(() => resetFilters ? {} : getStorageObject('selectedFilters', {}) || {});\n\tconst [filterOptions, setFilterOptions] = useState<any>();\n\tconst [recruiters, setRecruiters] = useState<Record<number, Recruiter>>(getStorageObject(\"recruiters\", {}) || {});\n\tconst [filterDialogIsOpen, setFilterDialogIsOpen] = useState<boolean>(false);\n\tconst [mobileTab, setMobileTab] = useState<string>(\"listTab\");\n\tconst [favorites, setFavorites] = useState<number[]>([]);\n\tconst [filterByFavorites, setFilterByFavorites] = useState<boolean>(false);\n\n\tconst setNewFilteredListings = (filteredListings: Listing[]) => {\n\t\tsetFilteredListings(filteredListings);\n\t};\n\n\tuseEffect(() => {\n\t\tif (!sortSetting) return;\n\t\tlocalStorage.setItem('sortSetting', JSON.stringify(sortSetting));\n\t\tsetNewFilteredListings(filteredListings);\n\t}, [sortSetting]);\n\n\tuseEffect(() => {\n\t\tconst loadedFavorites = JSON.parse(localStorage.getItem('favorites') || '[]');\n\t\tsetFavorites(loadedFavorites);\n\t}, []);\n\n\tuseEffect(() => {\n\t\tsetStorageObject(\"commuteLocation\", commuteLocation);\n\t}, [commuteLocation]);\n\n\tuseEffect(() => {\n\t\tif (!commuteLocation) return;\n\n\t\tasync function fetchEntities() {\n\t\t\tconst distinctEntityIds = [\n\t\t\t\t...new Set(allListings.map(listing => listing.entityId ?? -1))\n\t\t\t];\n\t\t\ttry {\n\t\t\t\tconst fetchedEntities = await getListingEntities(\n\t\t\t\t\tdistinctEntityIds,\n\t\t\t\t\t`${commuteLocation.lat}, ${commuteLocation.lng}`\n\t\t\t\t);\n\t\t\t\tsetListingEntities(fetchedEntities);\n\t\t\t\tconst newFilteredListings: Listing[] = [...filteredListings] ?? [];\n\t\t\t\tfor (let i = 0; i < allListings.length; i++) {\n\t\t\t\t\tconst listing = newFilteredListings[i];\n\t\t\t\t\tif (\n\t\t\t\t\t\tlisting &&\n\t\t\t\t\t\tlisting.fields &&\n\t\t\t\t\t\tlisting.entityId !== undefined &&\n\t\t\t\t\t\tlisting.entityId !== -1\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst entityId = listing.entityId;\n\t\t\t\t\t\tconst travelTime = fetchedEntities[entityId]?.travelTime;\n\n\t\t\t\t\t\tif (travelTime !== undefined && listing.fields) {\n\t\t\t\t\t\t\tlisting.fields.travelTime = travelTime;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tsetNewFilteredListings(newFilteredListings);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(\"Failed to fetch listing entities:\", error);\n\t\t\t}\n\t\t}\n\n\t\tfetchEntities();\n\t}, [commuteLocation, allListings, siteConfig.companyId]);\n\n\tuseEffect(() => {\n\t\tconst handleFetchListings = async () => {\n\t\t\tif (!getStorageObject('listings') ?? [].length) {\n\t\t\t\tsetLoading(true);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst {\n\t\t\t\t\tlistingsResult,\n\t\t\t\t\tfetchedRecruiters,\n\t\t\t\t\tfetchedEntities,\n\t\t\t\t\tdistinctItems\n\t\t\t\t} = await fetchListings(query ?? '', siteConfig, commuteLocation);\n\t\t\t\tsetAllListings(listingsResult);\n\t\t\t\tsetRecruiters(fetchedRecruiters);\n\t\t\t\tsetListingEntities(fetchedEntities);\n\t\t\t\tsetMapItems(distinctItems);\n\t\t\t\tsetStorageObject(\"mapItems\", distinctItems);\n\t\t\t\tsetStorageObject(\"listingEntities\", fetchedEntities);\n\t\t\t\tsetStorageObject(\"recruiters\", fetchedRecruiters);\n\t\t\t\tsetStorageObject(\"listings\", listingsResult);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\tsetLoading(false);\n\t\t};\n\t\thandleFetchListings();\n\t}, [query, siteConfig]);\n\n\tuseEffect(() => {\n\t\tconst processListings = () => {\n\t\t\tlet filteredListings: Listing[];\n\t\t\tconst { mapItems, filteredListings: tempFilteredListings } = applyFilters(\n\t\t\t\tallListings,\n\t\t\t\tselectedFilters,\n\t\t\t\tquery,\n\t\t\t\tlistingEntities,\n\t\t\t\tfavorites,\n\t\t\t\tsiteConfig\n\t\t\t);\n\t\t\tfilteredListings = tempFilteredListings;\n\n\t\t\tif (filterByFavorites) {\n\t\t\t\tfilteredListings = filteredListings.filter((x: Listing) => favorites.includes(x.id));\n\t\t\t}\n\t\t\tsetNewFilteredListings(filteredListings);\n\t\t\tif (firstLoad && selectedFilters) {\n\t\t\t\t// Update URL with filters if needed\n\t\t\t} else if (Object.keys(selectedFilters).length === 0 && !firstLoad) {\n\t\t\t\tlocalStorage.removeItem('selectedFilters');\n\t\t\t} else if (!firstLoad) {\n\t\t\t\tsetStorageObject('selectedFilters', selectedFilters);\n\t\t\t}\n\t\t\tquery != null ? localStorage.setItem('query', query) : localStorage.removeItem('query');\n\t\t\tsetMapItems(mapItems);\n\n\t\t\tif (selectedFilters) {\n\t\t\t\tconst keys = Object.keys(selectedFilters);\n\t\t\t\tconst lastKey = keys[keys.length - 1];\n\t\t\t\tconst options = generateFilterOptions(\n\t\t\t\t\tfirstLoad ? allListings : filteredListings,\n\t\t\t\t\tallListings,\n\t\t\t\t\tsiteConfig,\n\t\t\t\t\tfilterOptions,\n\t\t\t\t\tlastKey,\n\t\t\t\t\tfavorites\n\t\t\t\t);\n\t\t\t\tif (options) {\n\t\t\t\t\tsetFilterOptions(options);\n\t\t\t\t\tif (firstLoad) setFirstLoad(false);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tprocessListings();\n\t}, [selectedFilters, query, listingEntities, filterByFavorites, favorites]);\n\n\tconst handleFilterListingsByLocation = (selectedLocation: any) => {\n\t\tconst { filteredListings } = filterListingsByLocation(\n\t\t\tallListings,\n\t\t\tselectedLocation,\n\t\t\tlistingEntities\n\t\t);\n\t\tsetNewFilteredListings(filteredListings);\n\t};\n\n\tconst handleSettingFavorites = (newFavorites: number[] | null) => {\n\t\tif (newFavorites == null) {\n\t\t\tlocalStorage.removeItem('favorites');\n\t\t} else {\n\t\t\tsetFavorites(newFavorites);\n\t\t\tlocalStorage.setItem('favorites', JSON.stringify(newFavorites));\n\t\t}\n\t};\n\n\treturn (\n\t\t<MapListContext.Provider value={{\n\t\t\tloading,\n\t\t\tallListings,\n\t\t\tfilteredListings,\n\t\t\tmapItems,\n\t\t\tquery,\n\t\t\tsetNewFilteredListings,\n\t\t\tsetQuery,\n\t\t\tlistingEntities,\n\t\t\tselectedFilters,\n\t\t\tsetSelectedFilters,\n\t\t\tfilterOptions,\n\t\t\trecruiters,\n\t\t\thandleFilterListingsByLocation,\n\t\t\tfilterDialogIsOpen,\n\t\t\tsetFilterDialogIsOpen,\n\t\t\tsetMobileTab,\n\t\t\tmobileTab,\n\t\t\tsiteConfig,\n\t\t\tfavorites,\n\t\t\thandleSettingFavorites,\n\t\t\tsetFilterByFavorites,\n\t\t\tfilterByFavorites,\n\t\t\tcommuteLocation,\n\t\t\tsetCommuteLocation,\n\t\t\tnavigateToDetails,\n\t\t\tnavigateToEasyApply,\n\t\t\tLink,\n\t\t\tlinkFormat,\n\t\t\tsortSetting,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E,gBAAgB,EAAE,GAAG,wBAAwB,CACpD,WAAW,EACX,gBAAgB,EAChB,eAAe,CACf,CAAC;QACF,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;AAC1C,KAAC,CAAC;AAEF,IAAA,MAAM,sBAAsB,GAAG,CAAC,YAA6B,KAAI;QAChE,IAAI,YAAY,IAAI,IAAI,EAAE;AACzB,YAAA,YAAY,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AACrC,SAAA;AAAM,aAAA;YACN,YAAY,CAAC,YAAY,CAAC,CAAC;AAC3B,YAAA,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;AAChE,SAAA;AACF,KAAC,CAAC;AAEF,IAAA,QACC,KAAC,CAAA,aAAA,CAAA,cAAc,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE;YAC/B,OAAO;YACP,WAAW;YACX,gBAAgB;YAChB,QAAQ;YACR,KAAK;YACL,sBAAsB;YACtB,QAAQ;YACR,eAAe;YACf,eAAe;YACf,kBAAkB;YAClB,aAAa;YACb,UAAU;YACV,8BAA8B;YAC9B,kBAAkB;YAClB,qBAAqB;YACrB,YAAY;YACZ,SAAS;YACT,UAAU;YACV,SAAS;YACT,sBAAsB;YACtB,oBAAoB;YACpB,iBAAiB;YACjB,eAAe;YACf,kBAAkB;YAClB,iBAAiB;YACjB,mBAAmB;YACnB,IAAI;YACJ,UAAU;YACV,WAAW;YACX,cAAc;YACd,UAAU;SACV,EACC,EAAA,QAAQ,CACgB,EACzB;AACH;;;;"}
@@ -1,4 +1,4 @@
1
- import React, { useContext, createContext } from 'react';
1
+ import React, { createContext, useContext } from 'react';
2
2
  import { eventTypes } from '../constants/eventTypes.js';
3
3
 
4
4
  var TrackEventContext = /*#__PURE__*/createContext();
@@ -1,33 +1,15 @@
1
- import { asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import api from '../apis/hcApi.js';
3
2
 
4
- var getMapConfig = /*#__PURE__*/function () {
5
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
6
- var response;
7
- return _regeneratorRuntime().wrap(function _callee$(_context) {
8
- while (1) switch (_context.prev = _context.next) {
9
- case 0:
10
- _context.prev = 0;
11
- _context.next = 3;
12
- return api.get("/MapConfig");
13
- case 3:
14
- response = _context.sent;
15
- return _context.abrupt("return", response);
16
- case 7:
17
- _context.prev = 7;
18
- _context.t0 = _context["catch"](0);
19
- console.error("Error retrieving map configuration:", _context.t0);
20
- throw _context.t0;
21
- case 11:
22
- case "end":
23
- return _context.stop();
24
- }
25
- }, _callee, null, [[0, 7]]);
26
- }));
27
- return function getMapConfig() {
28
- return _ref.apply(this, arguments);
29
- };
30
- }();
3
+ const getMapConfig = async () => {
4
+ try {
5
+ const response = await api.get(`/MapConfig`);
6
+ return response;
7
+ }
8
+ catch (error) {
9
+ console.error("Error retrieving map configuration:", error);
10
+ throw error;
11
+ }
12
+ };
31
13
 
32
14
  export { getMapConfig };
33
15
  //# sourceMappingURL=configService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"configService.js","sources":["../../src/services/configService.js"],"sourcesContent":["import api from '~/apis/hcApi';\r\n\r\nexport const getMapConfig = async () => {\r\n\r\n\ttry {\r\n\t\tconst response = await api.get(`/MapConfig`);\r\n\t\treturn response;\r\n\t} catch (error) {\r\n\t\tconsole.error(\"Error retrieving map configuration:\", error);\r\n\t\tthrow error;\r\n\t}\r\n};\r\n\r\nexport default {\r\n\tgetMapConfig\r\n};\r\n"],"names":["getMapConfig","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","response","wrap","_callee$","_context","prev","next","api","get","sent","abrupt","t0","console","error","stop","apply","arguments"],"mappings":";;;IAEaA,YAAY,gBAAA,YAAA;EAAA,IAAAC,IAAA,GAAAC,iBAAA,eAAAC,mBAAA,EAAAC,CAAAA,IAAA,CAAG,SAA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["../../src/services/configService.ts"],"sourcesContent":["import api from '~/apis/hcApi';\nimport { MapConfig } from '~/types/config/MapConfig';\n\nexport const getMapConfig = async (): Promise<MapConfig> => {\n\ttry {\n\t\tconst response = await api.get<MapConfig>(`/MapConfig`);\n\t\treturn response;\n\t} catch (error) {\n\t\tconsole.error(\"Error retrieving map configuration:\", error);\n\t\tthrow error;\n\t}\n};\n\nexport default {\n\tgetMapConfig\n};\n"],"names":[],"mappings":";;AAGa,MAAA,YAAY,GAAG,YAA+B;IAC1D,IAAI;QACH,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,GAAG,CAAY,CAAY,UAAA,CAAA,CAAC,CAAC;AACxD,QAAA,OAAO,QAAQ,CAAC;AAChB,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;AACf,QAAA,OAAO,CAAC,KAAK,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAAC;AAC5D,QAAA,MAAM,KAAK,CAAC;AACZ,KAAA;AACF;;;;"}
@@ -1,61 +1,36 @@
1
- import { asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../_virtual/_rollupPluginBabelHelpers.js';
2
-
3
- var searchNearbyPlaces = /*#__PURE__*/function () {
4
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(typesArray, location, radius) {
5
- var url, headers, data, response;
6
- return _regeneratorRuntime().wrap(function _callee$(_context) {
7
- while (1) switch (_context.prev = _context.next) {
8
- case 0:
9
- url = 'https://places.googleapis.com/v1/places:searchNearby';
10
- headers = {
11
- 'Content-Type': 'application/json',
12
- 'X-Goog-Api-Key': "AIzaSyAXPlfaoMCrmjNV1u-vFYdLBi7GkGeh4S4",
13
- 'X-Goog-FieldMask': 'places.location,places.displayName,places.types'
14
- };
15
- data = {
16
- includedTypes: typesArray,
17
- maxResultCount: 20,
18
- locationRestriction: {
19
- circle: {
20
- center: location,
21
- radius: radius
22
- }
23
- }
24
- };
25
- _context.prev = 3;
26
- _context.next = 6;
27
- return fetch(url, {
28
- method: 'POST',
29
- headers: headers,
30
- body: JSON.stringify(data)
31
- });
32
- case 6:
33
- response = _context.sent;
34
- if (response.ok) {
35
- _context.next = 9;
36
- break;
37
- }
38
- throw new Error("HTTP error! status: ".concat(response.status));
39
- case 9:
40
- _context.next = 11;
41
- return response.json();
42
- case 11:
43
- return _context.abrupt("return", _context.sent);
44
- case 14:
45
- _context.prev = 14;
46
- _context.t0 = _context["catch"](3);
47
- console.error('Error making the Nearby Search request:', _context.t0);
48
- throw _context.t0;
49
- case 18:
50
- case "end":
51
- return _context.stop();
52
- }
53
- }, _callee, null, [[3, 14]]);
54
- }));
55
- return function searchNearbyPlaces(_x, _x2, _x3) {
56
- return _ref.apply(this, arguments);
57
- };
58
- }();
1
+ const searchNearbyPlaces = async (typesArray, location, radius) => {
2
+ const url = 'https://places.googleapis.com/v1/places:searchNearby';
3
+ const headers = {
4
+ 'Content-Type': 'application/json',
5
+ 'X-Goog-Api-Key': "AIzaSyAXPlfaoMCrmjNV1u-vFYdLBi7GkGeh4S4",
6
+ 'X-Goog-FieldMask': 'places.location,places.displayName,places.types'
7
+ };
8
+ const data = {
9
+ includedTypes: typesArray,
10
+ maxResultCount: 20,
11
+ locationRestriction: {
12
+ circle: {
13
+ center: location,
14
+ radius: radius
15
+ }
16
+ }
17
+ };
18
+ try {
19
+ const response = await fetch(url, {
20
+ method: 'POST',
21
+ headers: headers,
22
+ body: JSON.stringify(data)
23
+ });
24
+ if (!response.ok) {
25
+ throw new Error(`HTTP error! status: ${response.status}`);
26
+ }
27
+ return await response.json();
28
+ }
29
+ catch (error) {
30
+ console.error('Error making the Nearby Search request:', error);
31
+ throw error;
32
+ }
33
+ };
59
34
 
60
35
  export { searchNearbyPlaces };
61
36
  //# sourceMappingURL=googlePlacesNearbyService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"googlePlacesNearbyService.js","sources":["../../src/services/googlePlacesNearbyService.js"],"sourcesContent":["export const searchNearbyPlaces = async (typesArray, location, radius) => {\r\n\tconst url = 'https://places.googleapis.com/v1/places:searchNearby';\r\n\tconst headers = {\r\n\t\t'Content-Type': 'application/json',\r\n\t\t'X-Goog-Api-Key': process.env.GOOGLE_MAPS_API_KEY,\r\n\t\t'X-Goog-FieldMask': 'places.location,places.displayName,places.types'\r\n\t};\r\n\tconst data = {\r\n\t\tincludedTypes: typesArray,\r\n\t\tmaxResultCount: 20,\r\n\t\tlocationRestriction: {\r\n\t\t\tcircle: {\r\n\t\t\t\tcenter: location,\r\n\t\t\t\tradius: radius\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\ttry {\r\n\t\tconst response = await fetch(url, {\r\n\t\t\tmethod: 'POST',\r\n\t\t\theaders: headers,\r\n\t\t\tbody: JSON.stringify(data)\r\n\t\t});\r\n\t\tif (!response.ok) {\r\n\t\t\tthrow new Error(`HTTP error! status: ${response.status}`);\r\n\t\t}\r\n\t\treturn await response.json();\r\n\t} catch (error) {\r\n\t\tconsole.error('Error making the Nearby Search request:', error);\r\n\t\tthrow error;\r\n\t}\r\n};\r\n"],"names":["searchNearbyPlaces","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","typesArray","location","radius","url","headers","data","response","wrap","_callee$","_context","prev","next","includedTypes","maxResultCount","locationRestriction","circle","center","fetch","method","body","JSON","stringify","sent","ok","Error","concat","status","json","abrupt","t0","console","error","stop","_x","_x2","_x3","apply","arguments"],"mappings":";;IAAaA,kBAAkB,gBAAA,YAAA;AAAA,EAAA,IAAAC,IAAA,GAAAC,iBAAA,eAAAC,mBAAA,EAAAC,CAAAA,IAAA,CAAG,SAAAC,OAAOC,CAAAA,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAA;AAAA,IAAA,IAAAC,GAAA,EAAAC,OAAA,EAAAC,IAAA,EAAAC,QAAA,CAAA;AAAA,IAAA,OAAAT,mBAAA,EAAA,CAAAU,IAAA,CAAA,SAAAC,SAAAC,QAAA,EAAA;AAAA,MAAA,OAAA,CAAA,EA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;AAAA,QAAA,KAAA,EAAA;AAAA,UAAA,OAAAlB,QAAA,CAAAmB,MAAA,CAAAnB,QAAAA,EAAAA,QAAA,CAAAa,IAAA,CAAA,CAAA;AAAA,QAAA,KAAA,EAAA;AAAAb,UAAAA,QAAA,CAAAC,IAAA,GAAA,EAAA,CAAA;UAAAD,QAAA,CAAAoB,EAAA,GAAApB,QAAA,CAAA,OAAA,CAAA,CAAA,CAAA,CAAA,CAAA;UAE5BqB,OAAO,CAACC,KAAK,CAAC,yCAAyC,EAAAtB,QAAA,CAAAoB,EAAO,CAAC,CAAA;UAAC,MAAApB,QAAA,CAAAoB,EAAA,CAAA;AAAA,QAAA,KAAA,EAAA,CAAA;AAAA,QAAA,KAAA,KAAA;UAAA,OAAApB,QAAA,CAAAuB,IAAA,EAAA,CAAA;AAAA,OAAA;AAAA,KAAA,EAAAjC,OAAA,EAAA,IAAA,EAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA;GAGjE,CAAA,CAAA,CAAA;AAAA,EAAA,OAAA,SAhCYL,kBAAkBA,CAAAuC,EAAA,EAAAC,GAAA,EAAAC,GAAA,EAAA;AAAA,IAAA,OAAAxC,IAAA,CAAAyC,KAAA,CAAA,IAAA,EAAAC,SAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAAA,CAgC9B;;;;"}
1
+ {"version":3,"file":"googlePlacesNearbyService.js","sources":["../../src/services/googlePlacesNearbyService.ts"],"sourcesContent":["export interface Location {\r\n\tlatitude: number;\r\n\tlongitude: number;\r\n}\r\n\r\nexport const searchNearbyPlaces = async (\r\n\ttypesArray: string[],\r\n\tlocation: Location,\r\n\tradius: number\r\n): Promise<any> => {\r\n\tconst url = 'https://places.googleapis.com/v1/places:searchNearby';\r\n\tconst headers = {\r\n\t\t'Content-Type': 'application/json',\r\n\t\t'X-Goog-Api-Key': process.env.GOOGLE_MAPS_API_KEY as string,\r\n\t\t'X-Goog-FieldMask': 'places.location,places.displayName,places.types'\r\n\t};\r\n\tconst data = {\r\n\t\tincludedTypes: typesArray,\r\n\t\tmaxResultCount: 20,\r\n\t\tlocationRestriction: {\r\n\t\t\tcircle: {\r\n\t\t\t\tcenter: location,\r\n\t\t\t\tradius: radius\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\ttry {\r\n\t\tconst response = await fetch(url, {\r\n\t\t\tmethod: 'POST',\r\n\t\t\theaders: headers,\r\n\t\t\tbody: JSON.stringify(data)\r\n\t\t});\r\n\t\tif (!response.ok) {\r\n\t\t\tthrow new Error(`HTTP error! status: ${response.status}`);\r\n\t\t}\r\n\t\treturn await response.json();\r\n\t} catch (error) {\r\n\t\tconsole.error('Error making the Nearby Search request:', error);\r\n\t\tthrow error;\r\n\t}\r\n};\r\n"],"names":[],"mappings":"AAKO,MAAM,kBAAkB,GAAG,OACjC,UAAoB,EACpB,QAAkB,EAClB,MAAc,KACG;IACjB,MAAM,GAAG,GAAG,sDAAsD,CAAC;AACnE,IAAA,MAAM,OAAO,GAAG;AACf,QAAA,cAAc,EAAE,kBAAkB;AAClC,QAAA,gBAAgB,EAAE,yCAAyC;AAC3D,QAAA,kBAAkB,EAAE,iDAAiD;KACrE,CAAC;AACF,IAAA,MAAM,IAAI,GAAG;AACZ,QAAA,aAAa,EAAE,UAAU;AACzB,QAAA,cAAc,EAAE,EAAE;AAClB,QAAA,mBAAmB,EAAE;AACpB,YAAA,MAAM,EAAE;AACP,gBAAA,MAAM,EAAE,QAAQ;AAChB,gBAAA,MAAM,EAAE,MAAM;AACd,aAAA;AACD,SAAA;KACD,CAAC;IAEF,IAAI;AACH,QAAA,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;AACjC,YAAA,MAAM,EAAE,MAAM;AACd,YAAA,OAAO,EAAE,OAAO;AAChB,YAAA,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;AAC1B,SAAA,CAAC,CAAC;AACH,QAAA,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;YACjB,MAAM,IAAI,KAAK,CAAC,CAAA,oBAAA,EAAuB,QAAQ,CAAC,MAAM,CAAE,CAAA,CAAC,CAAC;AAC1D,SAAA;AACD,QAAA,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC7B,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;AACf,QAAA,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,KAAK,CAAC,CAAC;AAChE,QAAA,MAAM,KAAK,CAAC;AACZ,KAAA;AACF;;;;"}
@@ -1,83 +1,43 @@
1
- import { asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime, toConsumableArray as _toConsumableArray } from '../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import { getListings } from './listingService.js';
3
2
  import { getRecruiters } from './recruiterService.js';
4
3
  import { getListingEntities } from './listingEntityService.js';
5
4
  import { getDistinctItemsByProximity } from '../util/mapUtil.js';
6
5
 
7
- var fetchListings = /*#__PURE__*/function () {
8
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(query, siteConfig) {
9
- var commuteLocation,
10
- listingsResult,
11
- recruiterIds,
12
- fetchedRecruiters,
13
- distinctEntityIds,
14
- fetchedEntities,
15
- i,
16
- distinctItems,
17
- _args = arguments;
18
- return _regeneratorRuntime().wrap(function _callee$(_context) {
19
- while (1) switch (_context.prev = _context.next) {
20
- case 0:
21
- commuteLocation = _args.length > 2 && _args[2] !== undefined ? _args[2] : null;
22
- _context.prev = 1;
23
- _context.next = 4;
24
- return getListings(siteConfig.companyId, 5000, 1, query);
25
- case 4:
26
- listingsResult = _context.sent;
27
- recruiterIds = _toConsumableArray(new Set(listingsResult.map(function (listing) {
28
- return listing.recruiterId;
29
- })));
30
- _context.next = 8;
31
- return getRecruiters(recruiterIds);
32
- case 8:
33
- fetchedRecruiters = _context.sent;
34
- distinctEntityIds = _toConsumableArray(new Set(listingsResult.map(function (listing) {
35
- return listing.entityId;
36
- })));
37
- if (commuteLocation) {
38
- _context.next = 16;
39
- break;
40
- }
41
- _context.next = 13;
42
- return getListingEntities(distinctEntityIds);
43
- case 13:
44
- _context.t0 = _context.sent;
45
- _context.next = 19;
46
- break;
47
- case 16:
48
- _context.next = 18;
49
- return getListingEntities(distinctEntityIds, "".concat(commuteLocation.lat, ", ").concat(commuteLocation.lng));
50
- case 18:
51
- _context.t0 = _context.sent;
52
- case 19:
53
- fetchedEntities = _context.t0;
54
- for (i = 0; i < listingsResult.length; i++) {
55
- if (listingsResult[i].entityId != -1) {
56
- listingsResult[i].fields.travelTime = fetchedEntities[listingsResult[i].entityId].travelTime;
57
- }
58
- }
59
- distinctItems = getDistinctItemsByProximity(listingsResult, fetchedEntities);
60
- return _context.abrupt("return", {
61
- listingsResult: listingsResult,
62
- fetchedRecruiters: fetchedRecruiters,
63
- fetchedEntities: fetchedEntities,
64
- distinctItems: distinctItems
65
- });
66
- case 25:
67
- _context.prev = 25;
68
- _context.t1 = _context["catch"](1);
69
- console.error("Error fetching listings:", _context.t1);
70
- throw _context.t1;
71
- case 29:
72
- case "end":
73
- return _context.stop();
74
- }
75
- }, _callee, null, [[1, 25]]);
76
- }));
77
- return function fetchListings(_x, _x2) {
78
- return _ref.apply(this, arguments);
79
- };
80
- }();
6
+ const fetchListings = async (query, siteConfig, commuteLocation = null) => {
7
+ try {
8
+ const listingsResult = await getListings();
9
+ const recruiterIds = [
10
+ ...new Set(listingsResult.map(listing => listing.recruiterId))
11
+ ];
12
+ const fetchedRecruiters = await getRecruiters(recruiterIds);
13
+ const distinctEntityIds = [
14
+ ...new Set(listingsResult.map(listing => listing.entityId))
15
+ ];
16
+ const fetchedEntities = !commuteLocation
17
+ ? await getListingEntities(distinctEntityIds)
18
+ : await getListingEntities(distinctEntityIds, `${commuteLocation.lat}, ${commuteLocation.lng}`);
19
+ for (let i = 0; i < listingsResult.length; i++) {
20
+ const listing = listingsResult[i];
21
+ if (listing.entityId && listing.entityId !== -1 && listing.fields) {
22
+ const entity = fetchedEntities[listing.entityId];
23
+ if (entity) {
24
+ listing.fields.travelTime = entity.travelTime;
25
+ }
26
+ }
27
+ }
28
+ const distinctItems = getDistinctItemsByProximity(listingsResult, fetchedEntities);
29
+ return {
30
+ listingsResult,
31
+ fetchedRecruiters,
32
+ fetchedEntities,
33
+ distinctItems
34
+ };
35
+ }
36
+ catch (error) {
37
+ console.error("Error fetching listings:", error);
38
+ throw error;
39
+ }
40
+ };
81
41
 
82
42
  export { fetchListings as default };
83
43
  //# sourceMappingURL=listingAggregatorService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"listingAggregatorService.js","sources":["../../src/services/listingAggregatorService.js"],"sourcesContent":["import { getListings } from '~/services/listingService';\r\nimport { getRecruiters } from '~/services/recruiterService';\r\nimport { getListingEntities } from '~/services/listingEntityService';\r\n\r\nimport { getDistinctItemsByProximity } from '~/util/mapUtil';\r\n\r\nconst fetchListings = async (query, siteConfig, commuteLocation = null) => {\r\n\ttry {\r\n\t\tconst listingsResult = await getListings(\r\n\t\t\tsiteConfig.companyId,\r\n\t\t\t5000,\r\n\t\t\t1,\r\n\t\t\tquery\r\n\t\t);\r\n\t\tconst recruiterIds = [\r\n\t\t\t// eslint-disable-next-line no-undef\r\n\t\t\t...new Set(listingsResult.map(listing => listing.recruiterId))\r\n\t\t];\r\n\t\tconst fetchedRecruiters = await getRecruiters(recruiterIds);\r\n\r\n\t\tconst distinctEntityIds = [\r\n\t\t\t// eslint-disable-next-line no-undef\r\n\t\t\t...new Set(listingsResult.map(listing => listing.entityId))\r\n\t\t];\r\n\r\n\t\tconst fetchedEntities = !commuteLocation ? await getListingEntities(\r\n\t\t\tdistinctEntityIds) : await getListingEntities(\r\n\t\t\tdistinctEntityIds,`${commuteLocation.lat}, ${commuteLocation.lng}`);\r\n\t\tfor (var i = 0; i < listingsResult.length; i++) {\r\n\t\t\tif (listingsResult[i].entityId != -1) {\r\n\t\t\t\tlistingsResult[i].fields.travelTime = fetchedEntities[listingsResult[i].entityId].travelTime;\r\n\t\t\t}\r\n\t\t}\r\n\t\tconst distinctItems = getDistinctItemsByProximity(\r\n\t\t\tlistingsResult,\r\n\t\t\tfetchedEntities\r\n\t\t);\r\n\t\treturn {\r\n\t\t\tlistingsResult,\r\n\t\t\tfetchedRecruiters,\r\n\t\t\tfetchedEntities,\r\n\t\t\tdistinctItems\r\n\t\t};\r\n\t} catch (error) {\r\n\t\tconsole.error(\"Error fetching listings:\", error);\r\n\t\tthrow error;\r\n\t}\r\n};\r\n\r\nexport default fetchListings;\r\n"],"names":["fetchListings","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","query","siteConfig","commuteLocation","listingsResult","recruiterIds","fetchedRecruiters","distinctEntityIds","fetchedEntities","i","distinctItems","_args","arguments","wrap","_callee$","_context","prev","next","length","undefined","getListings","companyId","sent","_toConsumableArray","Set","map","listing","recruiterId","getRecruiters","entityId","getListingEntities","t0","concat","lat","lng","fields","travelTime","getDistinctItemsByProximity","abrupt","t1","console","error","stop","_x","_x2","apply"],"mappings":";;;;;;AAMA,IAAMA,aAAa,gBAAA,YAAA;AAAA,EAAA,IAAAC,IAAA,GAAAC,iBAAA,eAAAC,mBAAA,EAAA,CAAAC,IAAA,CAAG,SAAAC,OAAAA,CAAOC,KAAK,EAAEC,UAAU,EAAA;AAAA,IAAA,IAAAC,eAAA;MAAAC,cAAA;MAAAC,YAAA;MAAAC,iBAAA;MAAAC,iBAAA;MAAAC,eAAA;MAAAC,CAAA;MAAAC,aAAA;AAAAC,MAAAA,KAAA,GAAAC,SAAA,CAAA;AAAA,IAAA,OAAAd,mBAAA,EAAA,CAAAe,IAAA,CAAA,SAAAC,SAAAC,QAAA,EAAA;AAAA,MAAA,OAAA,CAAA,EAAA,QAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;AAAA,QAAA,KAAA,CAAA;UAAEd,eAAe,GAAAQ,KAAA,CAAAO,MAAA,GAAA,CAAA,IAAAP,KAAA,CAAA,CAAA,CA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B,OAAO,CAACC,KAAK,CAAC,0BAA0B,EAAA1B,QAAA,CAAAwB,EAAO,CAAC,CAAA;UAAC,MAAAxB,QAAA,CAAAwB,EAAA,CAAA;AAAA,QAAA,KAAA,EAAA,CAAA;AAAA,QAAA,KAAA,KAAA;UAAA,OAAAxB,QAAA,CAAA2B,IAAA,EAAA,CAAA;AAAA,OAAA;AAAA,KAAA,EAAA1C,OAAA,EAAA,IAAA,EAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA;GAGlD,CAAA,CAAA,CAAA;AAAA,EAAA,OAAA,SAzCKL,aAAaA,CAAAgD,EAAA,EAAAC,GAAA,EAAA;AAAA,IAAA,OAAAhD,IAAA,CAAAiD,KAAA,CAAA,IAAA,EAAAjC,SAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAAA,CAyClB;;;;"}
1
+ {"version":3,"file":"listingAggregatorService.js","sources":["../../src/services/listingAggregatorService.ts"],"sourcesContent":["import { getListings } from '~/services/listingService';\nimport { getRecruiters } from '~/services/recruiterService';\nimport { getListingEntities } from '~/services/listingEntityService';\n\nimport { getDistinctItemsByProximity } from '~/util/mapUtil';\nimport { Listing } from '~/types/Listings';\nimport { Recruiter } from '~/types/Recruiter';\nimport { ListingEntity } from '~/types/ListingEntity';\nimport { MapConfig } from '~/types/config/MapConfig';\n//import { ICommuteLocation } from '~/interfaces/ICommute';\n\ninterface SiteConfig {\n companyId: number;\n}\n\ninterface FetchListingsResult {\n listingsResult: Listing[];\n fetchedRecruiters: Recruiter[];\n fetchedEntities: Record<number, ListingEntity>;\n distinctItems: any; // Update this type based on the return type of getDistinctItemsByProximity\n}\n\nconst fetchListings = async (\n\tquery: string,\n\tsiteConfig: MapConfig,\n\tcommuteLocation: any | null = null\n): Promise<FetchListingsResult> => {\n\ttry {\n\t\tconst listingsResult = await getListings(\n\n\t\t);\n\n\t\tconst recruiterIds: number[] = [\n\t\t\t...new Set(listingsResult.map(listing => listing.recruiterId))\n\t\t] as number[];\n\n\t\tconst fetchedRecruiters = await getRecruiters(recruiterIds);\n\n\t\tconst distinctEntityIds: number[] = [\n\t\t\t...new Set(listingsResult.map(listing => listing.entityId))\n\t\t] as number[];\n\n\t\tconst fetchedEntities = !commuteLocation\n\t\t\t? await getListingEntities(distinctEntityIds)\n\t\t\t: await getListingEntities(\n\t\t\t\tdistinctEntityIds,\n\t\t\t\t`${commuteLocation.lat}, ${commuteLocation.lng}`\n\t\t\t);\n\t\tfor (let i = 0; i < listingsResult.length; i++) {\n\t\t\tconst listing = listingsResult[i];\n\t\t\tif (listing.entityId && listing.entityId !== -1 && listing.fields) {\n\t\t\t\tconst entity = fetchedEntities[listing.entityId];\n\t\t\t\tif (entity) {\n\t\t\t\t\tlisting.fields.travelTime = entity.travelTime;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst distinctItems = getDistinctItemsByProximity(\n\t\t\tlistingsResult,\n\t\t\tfetchedEntities\n\t\t);\n\n\t\treturn {\n\t\t\tlistingsResult,\n\t\t\tfetchedRecruiters,\n\t\t\tfetchedEntities,\n\t\t\tdistinctItems\n\t\t};\n\t} catch (error) {\n\t\tconsole.error(\"Error fetching listings:\", error);\n\t\tthrow error;\n\t}\n};\n\nexport default fetchListings;\n"],"names":[],"mappings":";;;;;AAsBM,MAAA,aAAa,GAAG,OACrB,KAAa,EACb,UAAqB,EACrB,eAAA,GAA8B,IAAI,KACD;IACjC,IAAI;AACH,QAAA,MAAM,cAAc,GAAG,MAAM,WAAW,EAEvC,CAAC;AAEF,QAAA,MAAM,YAAY,GAAa;AAC9B,YAAA,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;SAClD,CAAC;AAEd,QAAA,MAAM,iBAAiB,GAAG,MAAM,aAAa,CAAC,YAAY,CAAC,CAAC;AAE5D,QAAA,MAAM,iBAAiB,GAAa;AACnC,YAAA,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;SAC/C,CAAC;QAEd,MAAM,eAAe,GAAG,CAAC,eAAe;AACvC,cAAE,MAAM,kBAAkB,CAAC,iBAAiB,CAAC;AAC7C,cAAE,MAAM,kBAAkB,CACzB,iBAAiB,EACjB,CAAG,EAAA,eAAe,CAAC,GAAG,KAAK,eAAe,CAAC,GAAG,CAAA,CAAE,CAChD,CAAC;AACH,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC/C,YAAA,MAAM,OAAO,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;AAClC,YAAA,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,KAAK,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE;gBAClE,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AACjD,gBAAA,IAAI,MAAM,EAAE;oBACX,OAAO,CAAC,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC9C,iBAAA;AACD,aAAA;AACD,SAAA;QAED,MAAM,aAAa,GAAG,2BAA2B,CAChD,cAAc,EACd,eAAe,CACf,CAAC;QAEF,OAAO;YACN,cAAc;YACd,iBAAiB;YACjB,eAAe;YACf,aAAa;SACb,CAAC;AACF,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;AACf,QAAA,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;AACjD,QAAA,MAAM,KAAK,CAAC;AACZ,KAAA;AACF;;;;"}
@@ -1,36 +1,15 @@
1
- import { asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import api from '../apis/hcApi.js';
3
2
 
4
- var getListingEntities = /*#__PURE__*/function () {
5
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(entityIds) {
6
- var origin,
7
- response,
8
- _args = arguments;
9
- return _regeneratorRuntime().wrap(function _callee$(_context) {
10
- while (1) switch (_context.prev = _context.next) {
11
- case 0:
12
- origin = _args.length > 1 && _args[1] !== undefined ? _args[1] : '';
13
- _context.prev = 1;
14
- _context.next = 4;
15
- return api.post("/ListingEntities?origin=".concat(origin), entityIds);
16
- case 4:
17
- response = _context.sent;
18
- return _context.abrupt("return", response);
19
- case 8:
20
- _context.prev = 8;
21
- _context.t0 = _context["catch"](1);
22
- console.error("Error fetching listing entities:", _context.t0);
23
- throw _context.t0;
24
- case 12:
25
- case "end":
26
- return _context.stop();
27
- }
28
- }, _callee, null, [[1, 8]]);
29
- }));
30
- return function getListingEntities(_x) {
31
- return _ref.apply(this, arguments);
32
- };
33
- }();
3
+ const getListingEntities = async (entityIds, origin = '') => {
4
+ try {
5
+ const response = await api.post(`/ListingEntities?origin=${origin}`, entityIds);
6
+ return response;
7
+ }
8
+ catch (error) {
9
+ console.error("Error fetching listing entities:", error);
10
+ throw error;
11
+ }
12
+ };
34
13
 
35
14
  export { getListingEntities };
36
15
  //# sourceMappingURL=listingEntityService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"listingEntityService.js","sources":["../../src/services/listingEntityService.js"],"sourcesContent":["import api from '~/apis/hcApi';\r\n\r\nexport const getListingEntities = async (entityIds, origin = '') => {\r\n\ttry {\r\n\t\tconst response = await api.post(`/ListingEntities?origin=${origin}`, entityIds);\r\n\t\treturn response;\r\n\t} catch (error) {\r\n\t\tconsole.error(\"Error fetching listing entities:\", error);\r\n\t\tthrow error;\r\n\t}\r\n};\r\n\r\nexport default {\r\n\tgetListingEntities\r\n};\r\n"],"names":["getListingEntities","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","entityIds","origin","response","_args","arguments","wrap","_callee$","_context","prev","next","length","undefined","api","post","concat","sent","abrupt","t0","console","error","stop","_x","apply"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,KAAA;UAAA,OAAAV,QAAA,CAAAa,IAAA,EAAA,CAAA;AAAA,OAAA;AAAA,KAAA,EAAArB,OAAA,EAAA,IAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA;GAG1D,CAAA,CAAA,CAAA;EAAA,OARYL,SAAAA,kBAAkBA,CAAA2B,EAAA,EAAA;AAAA,IAAA,OAAA1B,IAAA,CAAA2B,KAAA,CAAA,IAAA,EAAAlB,SAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAAA,CAQ9B;;;;"}
1
+ {"version":3,"file":"listingEntityService.js","sources":["../../src/services/listingEntityService.ts"],"sourcesContent":["import api from '~/apis/hcApi';\nimport { ListingEntity } from '~/types/ListingEntity';\n\nexport const getListingEntities = async (entityIds: number[], origin = ''): Promise<ListingEntity[]> => {\n\ttry {\n\t\tconst response = await api.post<ListingEntity[]>(`/ListingEntities?origin=${origin}`, entityIds);\n\t\treturn response;\n\t} catch (error) {\n\t\tconsole.error(\"Error fetching listing entities:\", error);\n\t\tthrow error;\n\t}\n};\n\nexport default {\n\tgetListingEntities\n};\n"],"names":[],"mappings":";;AAGO,MAAM,kBAAkB,GAAG,OAAO,SAAmB,EAAE,MAAM,GAAG,EAAE,KAA8B;IACtG,IAAI;AACH,QAAA,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,CAAkB,CAAA,wBAAA,EAA2B,MAAM,CAAA,CAAE,EAAE,SAAS,CAAC,CAAC;AACjG,QAAA,OAAO,QAAQ,CAAC;AAChB,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;AACf,QAAA,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;AACzD,QAAA,MAAM,KAAK,CAAC;AACZ,KAAA;AACF;;;;"}
@@ -1,64 +1,30 @@
1
- import { asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from './_virtual/_rollupPluginBabelHelpers.js';
2
- import api from './apis/hcApi.js';
1
+ import api from '../apis/hcApi.js';
3
2
 
4
- var getListings = /*#__PURE__*/function () {
5
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
6
- var response;
7
- return _regeneratorRuntime().wrap(function _callee$(_context) {
8
- while (1) switch (_context.prev = _context.next) {
9
- case 0:
10
- _context.prev = 0;
11
- _context.next = 3;
12
- return api.get("/Listings");
13
- case 3:
14
- response = _context.sent;
15
- return _context.abrupt("return", response);
16
- case 7:
17
- _context.prev = 7;
18
- _context.t0 = _context["catch"](0);
19
- console.error(_context.t0);
20
- throw _context.t0;
21
- case 11:
22
- case "end":
23
- return _context.stop();
24
- }
25
- }, _callee, null, [[0, 7]]);
26
- }));
27
- return function getListings() {
28
- return _ref.apply(this, arguments);
29
- };
30
- }();
31
- var getListingDetails = /*#__PURE__*/function () {
32
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(listingId) {
33
- var response;
34
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
35
- while (1) switch (_context2.prev = _context2.next) {
36
- case 0:
37
- _context2.prev = 0;
38
- _context2.next = 3;
39
- return api.get("/ListingDetails/".concat(listingId));
40
- case 3:
41
- response = _context2.sent;
42
- return _context2.abrupt("return", response);
43
- case 7:
44
- _context2.prev = 7;
45
- _context2.t0 = _context2["catch"](0);
46
- console.error(_context2.t0);
47
- throw _context2.t0;
48
- case 11:
49
- case "end":
50
- return _context2.stop();
51
- }
52
- }, _callee2, null, [[0, 7]]);
53
- }));
54
- return function getListingDetails(_x) {
55
- return _ref2.apply(this, arguments);
56
- };
57
- }();
58
- var listingService = {
59
- getListings: getListings,
60
- getListingDetails: getListingDetails
3
+ const getListings = async (params) => {
4
+ try {
5
+ const query = new URLSearchParams();
6
+ if (params) {
7
+ if (params.location)
8
+ params.location.forEach(loc => query.append('location', loc));
9
+ if (params.category)
10
+ params.category.forEach(cat => query.append('category', cat));
11
+ if (params.categoryClass)
12
+ params.categoryClass.forEach(catClass => query.append('categoryClass', catClass));
13
+ if (params.education)
14
+ params.education.forEach(edu => query.append('education', edu));
15
+ if (params.city)
16
+ params.city.forEach(cty => query.append('city', cty));
17
+ if (params.state)
18
+ params.state.forEach(st => query.append('state', st));
19
+ }
20
+ const response = await api.get(`/Listings?${query.toString()}`);
21
+ return response;
22
+ }
23
+ catch (error) {
24
+ console.error(error);
25
+ throw error;
26
+ }
61
27
  };
62
28
 
63
- export { listingService as default, getListingDetails, getListings };
29
+ export { getListings };
64
30
  //# sourceMappingURL=listingService.js.map