@abcagency/hc-ui-components 1.3.17 → 1.3.19
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/dist/apis/hcApi.js +85 -183
- package/dist/apis/hcApi.js.map +1 -1
- package/dist/components/HireControlMap.js +10 -5
- package/dist/components/HireControlMap.js.map +1 -1
- package/dist/components/modules/accordions/MapAccordionItem.js +10 -67
- package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
- package/dist/components/modules/filter/index.js.map +1 -1
- package/dist/components/modules/filter/radio-item.js +1 -2
- package/dist/components/modules/filter/radio-item.js.map +1 -1
- package/dist/components/modules/filter/search.js +4 -4
- package/dist/components/modules/filter/search.js.map +1 -1
- package/dist/components/modules/jobListing/listing-details-container.js +45 -0
- package/dist/components/modules/jobListing/listing-details-container.js.map +1 -0
- package/dist/components/modules/jobListing/listing-details.js +24 -24
- package/dist/components/modules/jobListing/listing-details.js.map +1 -1
- package/dist/components/modules/{maps/list → list}/field-mapper.js +8 -7
- package/dist/components/modules/list/field-mapper.js.map +1 -0
- package/dist/components/modules/{maps/list → list}/header-item.js +2 -2
- package/dist/components/modules/list/header-item.js.map +1 -0
- package/dist/components/modules/{maps/list → list}/header.js +6 -4
- package/dist/components/modules/list/header.js.map +1 -0
- package/dist/components/modules/list/index.js +36 -0
- package/dist/components/modules/list/index.js.map +1 -0
- package/dist/components/modules/{maps/list → list}/item-expand-card/index.js +3 -1
- package/dist/components/modules/list/item-expand-card/index.js.map +1 -0
- package/dist/components/modules/{maps/list → list}/item-expand-card/recruiter-contact-nav.js +2 -2
- package/dist/components/modules/list/item-expand-card/recruiter-contact-nav.js.map +1 -0
- package/dist/components/modules/{maps/list → list}/item-expand-card/recruiter-details.js +1 -1
- package/dist/components/modules/list/item-expand-card/recruiter-details.js.map +1 -0
- package/dist/components/modules/list/item-expand-card/recruiter-headshot.js.map +1 -0
- package/dist/components/modules/list/item-list.js +28 -0
- package/dist/components/modules/list/item-list.js.map +1 -0
- package/dist/components/modules/list/list-item/index.js +75 -0
- package/dist/components/modules/list/list-item/index.js.map +1 -0
- package/dist/components/modules/list/list-item/list-item-container.js +47 -0
- package/dist/components/modules/list/list-item/list-item-container.js.map +1 -0
- package/dist/components/modules/{maps/list/list-item/index.js → list/list-item/list-item.js} +29 -33
- package/dist/components/modules/list/list-item/list-item.js.map +1 -0
- package/dist/components/modules/maps/map-list.js +3 -3
- package/dist/components/modules/maps/map-list.js.map +1 -1
- package/dist/constants/eventTypes.js +1 -1
- package/dist/constants/eventTypes.js.map +1 -1
- package/dist/contexts/mapContext.js +84 -113
- package/dist/contexts/mapContext.js.map +1 -1
- package/dist/contexts/mapListContext.js +181 -290
- package/dist/contexts/mapListContext.js.map +1 -1
- package/dist/contexts/trackEventContext.js +1 -1
- package/dist/services/configService.js +10 -28
- package/dist/services/configService.js.map +1 -1
- package/dist/services/googlePlacesNearbyService.js +33 -58
- package/dist/services/googlePlacesNearbyService.js.map +1 -1
- package/dist/services/listingAggregatorService.js +35 -75
- package/dist/services/listingAggregatorService.js.map +1 -1
- package/dist/services/listingEntityService.js +10 -31
- package/dist/services/listingEntityService.js.map +1 -1
- package/dist/services/listingService.js +26 -60
- package/dist/services/listingService.js.map +1 -1
- package/dist/services/recruiterService.js +11 -31
- package/dist/services/recruiterService.js.map +1 -1
- package/dist/types/apis/hcApi.d.ts +5 -0
- package/dist/types/clientToken.d.ts +2 -0
- package/dist/types/components/modules/accordions/MapAccordionItem.d.ts +9 -0
- package/dist/types/components/modules/accordions/default.d.ts +19 -0
- package/dist/types/components/modules/buttons/button-group-apply.d.ts +24 -0
- package/dist/types/components/modules/buttons/commute-pill.d.ts +5 -0
- package/dist/types/components/modules/buttons/default.d.ts +48 -0
- package/dist/types/components/modules/buttons/pill-wrapper.d.ts +3 -0
- package/dist/types/components/modules/dialogs/apply-dialog.d.ts +8 -0
- package/dist/types/components/modules/filter/sort.d.ts +8 -0
- package/dist/types/components/modules/grid.d.ts +8 -0
- package/dist/types/components/modules/icon.d.ts +10 -0
- package/dist/types/components/modules/jobListing/listing-details-container.d.ts +6 -0
- package/dist/types/components/modules/jobListing/listing-details.d.ts +18 -0
- package/dist/types/components/modules/list/field-mapper.d.ts +10 -0
- package/dist/types/components/modules/list/header-item.d.ts +11 -0
- package/dist/types/components/modules/list/header.d.ts +11 -0
- package/dist/types/components/modules/list/index.d.ts +9 -0
- package/dist/types/components/modules/list/item-expand-card/index.d.ts +7 -0
- package/dist/types/components/modules/list/item-expand-card/recruiter-contact-nav.d.ts +17 -0
- package/dist/types/components/modules/list/item-expand-card/recruiter-details.d.ts +21 -0
- package/dist/types/components/modules/list/item-expand-card/recruiter-headshot.d.ts +8 -0
- package/dist/types/components/modules/list/item-list.d.ts +21 -0
- package/dist/types/components/modules/list/list-item/index.d.ts +12 -0
- package/dist/types/components/modules/list/list-item/list-item-container.d.ts +14 -0
- package/dist/types/components/modules/list/list-item/list-item.d.ts +3 -0
- package/dist/types/constants/eventTypes.d.ts +13 -0
- package/dist/types/contexts/mapContext.d.ts +29 -0
- package/dist/types/contexts/mapListContext.d.ts +58 -0
- package/dist/types/contexts/trackEventContext.d.ts +6 -0
- package/dist/types/enums/SectionType.d.ts +9 -0
- package/dist/types/hooks/useList.d.ts +13 -0
- package/dist/types/services/configService.d.ts +6 -0
- package/dist/types/services/googlePlacesNearbyService.d.ts +5 -0
- package/dist/types/services/listingAggregatorService.d.ts +12 -0
- package/dist/types/services/listingEntityService.d.ts +6 -0
- package/dist/types/services/listingService.d.ts +9 -0
- package/dist/types/services/recruiterService.d.ts +6 -0
- package/dist/types/types/Address.d.ts +7 -0
- package/dist/types/types/ContentSection.d.ts +8 -0
- package/dist/types/types/GetListingParams.d.ts +8 -0
- package/dist/types/types/LatLng.d.ts +4 -0
- package/dist/types/types/ListingEntity.d.ts +10 -0
- package/dist/types/types/ListingFields.d.ts +20 -0
- package/dist/types/types/Listings.d.ts +31 -0
- package/dist/types/types/Recruiter.d.ts +9 -0
- package/dist/types/types/SimilarListing.d.ts +24 -0
- package/dist/types/types/config/Colors.d.ts +8 -0
- package/dist/types/types/config/MapConfig.d.ts +29 -0
- package/dist/types/types/config/PointsOfInterestConfig.d.ts +13 -0
- package/dist/types/types/config/SearchConfig.d.ts +4 -0
- package/dist/types/util/filterUtil.d.ts +28 -0
- package/dist/types/util/loading.d.ts +3 -0
- package/dist/types/util/localStorageUtil.d.ts +3 -0
- package/dist/types/util/mapUtil.d.ts +15 -0
- package/dist/types/util/sortUtil.d.ts +1 -0
- package/dist/types/util/stringUtils.d.ts +1 -0
- package/dist/util/filterUtil.js +34 -10
- package/dist/util/filterUtil.js.map +1 -1
- package/dist/util/localStorageUtil.js +37 -28
- package/dist/util/localStorageUtil.js.map +1 -1
- package/dist/util/mapUtil.js.map +1 -1
- package/package.json +22 -14
- package/rollup.config.mjs +23 -19
- package/src/apis/{hcApi.js → hcApi.ts} +27 -11
- package/src/components/HireControlMap.js +132 -129
- package/src/components/modules/accordions/MapAccordionItem.js +32 -74
- package/src/components/modules/filter/index.js +89 -89
- package/src/components/modules/filter/radio-item.js +0 -1
- package/src/components/modules/filter/search.js +93 -92
- package/src/components/modules/jobListing/listing-details-container.js +40 -0
- package/src/components/modules/jobListing/listing-details.js +209 -99
- package/src/components/modules/{maps/list → list}/field-mapper.js +114 -112
- package/src/components/modules/{maps/list → list}/header.js +49 -47
- package/src/components/modules/list/index.tsx +83 -0
- package/src/components/modules/{maps/list → list}/item-expand-card/index.js +24 -22
- package/src/components/modules/list/item-list.tsx +198 -0
- package/src/components/modules/list/list-item/index.js +70 -0
- package/src/components/modules/list/list-item/list-item-container.js +43 -0
- package/src/components/modules/{maps/list/list-item/index.js → list/list-item/list-item.js} +129 -135
- package/src/components/modules/maps/map-list.js +74 -74
- package/src/constants/eventTypes.js +13 -13
- package/src/contexts/mapContext.tsx +129 -0
- package/src/contexts/mapListContext.tsx +297 -0
- package/src/enums/SectionType.ts +9 -0
- package/src/services/{configService.js → configService.ts} +16 -16
- package/src/services/{googlePlacesNearbyService.js → googlePlacesNearbyService.ts} +11 -2
- package/src/services/listingAggregatorService.ts +76 -0
- package/src/services/listingEntityService.ts +16 -0
- package/src/services/listingService.ts +40 -0
- package/src/services/{recruiterService.js → recruiterService.ts} +18 -17
- package/src/types/Address.ts +7 -0
- package/src/types/ContentSection.ts +9 -0
- package/src/types/GetListingParams.ts +8 -0
- package/src/types/LatLng.ts +4 -0
- package/src/types/ListingEntity.ts +11 -0
- package/src/types/ListingFields.ts +20 -0
- package/src/types/Listings.ts +32 -0
- package/src/types/Recruiter.ts +9 -0
- package/src/types/SimilarListing.ts +24 -0
- package/src/types/config/Colors.ts +8 -0
- package/src/types/config/MapConfig.ts +30 -0
- package/src/types/config/PointsOfInterestConfig.ts +13 -0
- package/src/types/config/SearchConfig.ts +4 -0
- package/src/util/filterUtil.js +50 -6
- package/src/util/localStorageUtil.ts +34 -0
- package/src/util/mapUtil.js +91 -91
- package/tsconfig.json +23 -0
- package/dist/components/modules/maps/list/field-mapper.js.map +0 -1
- package/dist/components/modules/maps/list/header-item.js.map +0 -1
- package/dist/components/modules/maps/list/header.js.map +0 -1
- package/dist/components/modules/maps/list/index.js +0 -102
- package/dist/components/modules/maps/list/index.js.map +0 -1
- package/dist/components/modules/maps/list/item-expand-card/index.js.map +0 -1
- package/dist/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js.map +0 -1
- package/dist/components/modules/maps/list/item-expand-card/recruiter-details.js.map +0 -1
- package/dist/components/modules/maps/list/item-expand-card/recruiter-headshot.js.map +0 -1
- package/dist/components/modules/maps/list/list-item/index.js.map +0 -1
- package/dist/services/_virtual/_rollupPluginBabelHelpers.js +0 -372
- package/dist/services/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
- package/dist/services/apis/hcApi.js +0 -189
- package/dist/services/apis/hcApi.js.map +0 -1
- package/dist/services/clientToken.js +0 -7
- package/dist/services/clientToken.js.map +0 -1
- package/dist/services/styles/index.css +0 -3
- package/src/components/modules/maps/list/index.js +0 -112
- package/src/contexts/mapContext.js +0 -101
- package/src/contexts/mapListContext.js +0 -242
- package/src/services/listingAggregatorService.js +0 -50
- package/src/services/listingEntityService.js +0 -15
- package/src/services/listingService.js +0 -26
- package/src/util/localStorageUtil.js +0 -27
- /package/dist/components/modules/{maps/list → list}/item-expand-card/recruiter-headshot.js +0 -0
- /package/src/components/modules/{maps/list → list}/header-item.js +0 -0
- /package/src/components/modules/{maps/list → list}/item-expand-card/recruiter-contact-nav.js +0 -0
- /package/src/components/modules/{maps/list → list}/item-expand-card/recruiter-details.js +0 -0
- /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';\r\n\r\nimport { generateFilterOptions, applyFilters, filterListingsByLocation } from '~/util/filterUtil';\r\nimport { getStorageObject, setStorageObject } from '~/util/localStorageUtil';\r\n\r\nimport { getListingEntities } from \"~/services/listingEntityService\";\r\nimport fetchListings from '~/services/listingAggregatorService';\r\n\r\nconst MapListContext = createContext();\r\n\r\nexport const useMapList = () => useContext(MapListContext);\r\n\r\nconst getQuery = () => {\r\n\tlet query;\r\n\t//if (!hasQueryInUrl(location)) {\r\n\tquery = typeof window !== 'undefined' ? localStorage.getItem('query') : '';\r\n\t// }\r\n\t//else {\r\n\t// \tquery = filtersFromURL(location).query;\r\n\t// }\r\n\treturn query;\r\n};\r\n\r\nexport const MapListProvider = ({\r\n\tchildren,\r\n\tsiteConfig,\r\n\tresetFilters,\r\n\tnavigateToDetails,\r\n\tnavigateToEasyApply,\r\n\tLink,\r\n\tlinkFormat,\r\n\ttrackEvent\r\n}) => {\r\n\t// const location = useLocation();\r\n\t// const navigate = useNavigate();\r\n\tconst [allListings, setAllListings] = useState(getStorageObject(\"listings\", []));\r\n\tconst [filteredListings, setFilteredListings] = useState([]);\r\n\tconst [loading, setLoading] = useState(false);\r\n\tconst [mapItems, setMapItems] = useState(getStorageObject('mapItems', []));\r\n\tconst [query, setQuery] = useState(() => resetFilters ? null : getQuery());\r\n\tconst [sortSetting, setSortSetting] = useState(getStorageObject('sortSetting', null));\r\n\tconst [listingEntities, setListingEntities] = useState(getStorageObject(\"listingEntities\", null));\r\n\tconst [firstLoad, setFirstLoad] = useState(true);\r\n\tconst [commuteLocation, setCommuteLocation] = useState(getStorageObject('commuteLocation'));\r\n\tconst [selectedFilters, setSelectedFilters] = useState(() => resetFilters ? {} : getStorageObject('selectedFilters', {}));//hasFiltersInURL(location) ? filtersFromURL(location).filters : getStorageObject('selectedFilters', {}));\r\n\tconst [filterOptions, setFilterOptions] = useState();\r\n\tconst [recruiters, setRecruiters] = useState(getStorageObject(\"recruiters\", {}));\r\n\tconst [filterDialogIsOpen, setFilterDialogIsOpen] = useState(false);\r\n\tconst [mobileTab, setMobileTab] = useState(\"listTab\");\r\n\tconst [favorites, setFavorites] = useState([]);\r\n\tconst [filterByFavorites, setFilterByFavorites] = useState(false);\r\n\r\n\tconst setNewFilteredListings = filteredListings =>{\r\n\t\tsetFilteredListings(filteredListings);\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!sortSetting) return;\r\n\t\tlocalStorage.setItem('sortSetting', JSON.stringify(sortSetting));\r\n\t\tsetNewFilteredListings(filteredListings);\r\n\t}, [sortSetting]);\r\n\r\n\tuseEffect(() => {\r\n\t\tconst loadedFavorites = JSON.parse(localStorage.getItem('favorites')) || [];\r\n\t\tsetFavorites(loadedFavorites);\r\n\t}, []);\r\n\r\n\tuseEffect(() => {\r\n\t\tsetStorageObject(\"commuteLocation\", commuteLocation);\r\n\t}, [commuteLocation]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (commuteLocation === null || commuteLocation === '') return;\r\n\t\tasync function fetchEntities() {\r\n\t\t\tconst distinctEntityIds = [\r\n\t\t\t\t// eslint-disable-next-line no-undef\r\n\t\t\t\t...new Set(allListings.map(listing => listing.entityId))\r\n\t\t\t];\r\n\t\t\ttry {\r\n\t\t\t\tconst fetchedEntities = await getListingEntities(\r\n\t\t\t\t\tdistinctEntityIds,\r\n\t\t\t\t\t`${commuteLocation.lat}, ${commuteLocation.lng}`\r\n\t\t\t\t);\r\n\t\t\t\tsetListingEntities(fetchedEntities);\r\n\t\t\t\tvar newFilteredListings = filteredListings;\r\n\t\t\t\tfor (var i = 0; i < allListings.length; i++) {\r\n\t\t\t\t\tif (newFilteredListings[i].entityId != -1) {\r\n\t\t\t\t\t\tnewFilteredListings[i].fields.travelTime = fetchedEntities[newFilteredListings[i].entityId].travelTime;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor (var j = 0; j < newFilteredListings.length; j++) {\r\n\t\t\t\t\tif (newFilteredListings[j].entityId != -1) {\r\n\t\t\t\t\t\tnewFilteredListings[j].fields.travelTime = fetchedEntities[newFilteredListings[j].entityId].travelTime;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tsetNewFilteredListings(newFilteredListings);\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.error(\"Failed to fetch listing entities:\", error);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfetchEntities();\r\n\t}, [commuteLocation, allListings, siteConfig.companyId]);\r\n\r\n\tuseEffect(() => {\r\n\t\tconst handleFetchListings = async () => {\r\n\t\t\tif (!getStorageObject('listings', []).length > 0) {\r\n\t\t\t\tsetLoading(true);\r\n\t\t\t}\r\n\r\n\t\t\ttry {\r\n\t\t\t\tconst {\r\n\t\t\t\t\tlistingsResult,\r\n\t\t\t\t\tfetchedRecruiters,\r\n\t\t\t\t\tfetchedEntities,\r\n\t\t\t\t\tdistinctItems\r\n\t\t\t\t} = await fetchListings(query, siteConfig, commuteLocation);\r\n\t\t\t\tsetAllListings(listingsResult);\r\n\t\t\t\tsetRecruiters(fetchedRecruiters);\r\n\t\t\t\tsetListingEntities(fetchedEntities);\r\n\t\t\t\tsetMapItems(distinctItems);\r\n\t\t\t\tsetStorageObject(\"mapItems\", distinctItems);\r\n\t\t\t\tsetStorageObject(\"listingEntities\", fetchedEntities);\r\n\t\t\t\tsetStorageObject(\"recruiters\", fetchedRecruiters);\r\n\t\t\t\tsetStorageObject(\"listings\", listingsResult);\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.log(error);\r\n\t\t\t}\r\n\t\t\tsetLoading(false);\r\n\t\t};\r\n\t\thandleFetchListings();\r\n\t}, [query, siteConfig]);\r\n\r\n\tuseEffect(() => {\r\n\t\tconst processListings = () => {\r\n\t\t\tlet { filteredListings, mapItems } = applyFilters(\r\n\t\t\t\tallListings,\r\n\t\t\t\tselectedFilters,\r\n\t\t\t\tquery,\r\n\t\t\t\tlistingEntities,\r\n\t\t\t\tfavorites,\r\n\t\t\t\tsiteConfig\r\n\t\t\t);\r\n\t\t\tif (filterByFavorites) {\r\n\t\t\t\tfilteredListings = filteredListings.filter(x => favorites.includes(x.id));\r\n\t\t\t}\r\n\t\t\tsetNewFilteredListings(filteredListings);\r\n\t\t\t// if (firstLoad && hasFiltersInURL(location)) {\r\n\t\t\t// \tconst { filters } = filtersFromURL(location);\r\n\t\t\t// \tsetSelectedFilters(filters);\r\n\t\t\t// }\r\n\t\t\tif (firstLoad && selectedFilters) {\r\n\t\t\t\t//updateURLWithFilters(selectedFilters,location, navigate, query);\r\n\t\t\t} else if (Object.keys(selectedFilters).length === 0 && !firstLoad) {\r\n\t\t\t\tlocalStorage.removeItem('selectedFilters');\r\n\t\t\t\t//updateURLWithFilters(selectedFilters,location, navigate, query);\r\n\t\t\t} else if (!firstLoad) {\r\n\t\t\t\tsetStorageObject('selectedFilters', selectedFilters);\r\n\t\t\t\t//updateURLWithFilters(selectedFilters,location, navigate, query);\r\n\t\t\t}\r\n\t\t\tquery != null ? localStorage.setItem('query', query) : localStorage.removeItem('query');\r\n\t\t\tsetMapItems(mapItems);\r\n\r\n\t\t\tif (selectedFilters) {\r\n\t\t\t\tconst keys = Object.keys(selectedFilters);\r\n\t\t\t\tconst lastKey = keys[keys.length - 1];\r\n\t\t\t\tconst options = generateFilterOptions(\r\n\t\t\t\t\tfirstLoad ? allListings : filteredListings,\r\n\t\t\t\t\tallListings,\r\n\t\t\t\t\tsiteConfig,\r\n\t\t\t\t\tfilterOptions,\r\n\t\t\t\t\tlastKey,\r\n\t\t\t\t\tfavorites\r\n\t\t\t\t);\r\n\t\t\t\tif (options) {\r\n\t\t\t\t\tsetFilterOptions(options);\r\n\t\t\t\t\tif (firstLoad) setFirstLoad(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tprocessListings();\r\n\t}, [selectedFilters, query, listingEntities, filterByFavorites, favorites]);\r\n\r\n\tconst handleFilterListingsByLocation = selectedLocation => {\r\n\t\tlet { filteredListings } = filterListingsByLocation(\r\n\t\t\tallListings,\r\n\t\t\tselectedLocation,\r\n\t\t\tlistingEntities\r\n\t\t);\r\n\r\n\t\tsetNewFilteredListings(filteredListings);\r\n\t\t//setMapItems(mapItems);\r\n\t};\r\n\r\n\tconst handleSettingFavorites = newFavorites => {\r\n\t\tif (newFavorites == null) {\r\n\t\t\tlocalStorage.removeItem('favorites');\r\n\t\t} else {\r\n\t\t\tsetFavorites(newFavorites);\r\n\t\t\tlocalStorage.setItem('favorites', JSON.stringify(newFavorites));\r\n\t\t}\r\n\t};\r\n\r\n\treturn (\r\n\t\t<MapListContext.Provider value={{\r\n\t\t\tloading,\r\n\t\t\tallListings,\r\n\t\t\tfilteredListings,\r\n\t\t\tmapItems,\r\n\t\t\tquery,\r\n\t\t\tsetNewFilteredListings,\r\n\t\t\tsetQuery,\r\n\t\t\tlistingEntities,\r\n\t\t\tselectedFilters,\r\n\t\t\tsetSelectedFilters,\r\n\t\t\tfilterOptions,\r\n\t\t\trecruiters,\r\n\t\t\thandleFilterListingsByLocation,\r\n\t\t\tfilterDialogIsOpen,\r\n\t\t\tsetFilterDialogIsOpen,\r\n\t\t\tsetMobileTab,\r\n\t\t\tmobileTab,\r\n\t\t\tsiteConfig,\r\n\t\t\tfavorites,\r\n\t\t\thandleSettingFavorites,\r\n\t\t\tsetFilterByFavorites,\r\n\t\t\tfilterByFavorites,\r\n\t\t\tcommuteLocation,\r\n\t\t\tsetCommuteLocation,\r\n\t\t\tnavigateToDetails,\r\n\t\t\tnavigateToEasyApply,\r\n\t\t\tLink,\r\n\t\t\tlinkFormat,\r\n\t\t\tsortSetting,\r\n\t\t\tsetSortSetting,\r\n\t\t\ttrackEvent\r\n\t\t}}>\r\n\t\t\t{children}\r\n\t\t</MapListContext.Provider>\r\n\t);\r\n};\r\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","_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,gBAAGC,aAAa,EAAE,CAAA;AAEzBC,IAAAA,UAAU,GAAG,SAAbA,UAAUA,GAAA;EAAA,OAASC,UAAU,CAACH,cAAc,CAAC,CAAA;AAAA,EAAA;AAE1D,IAAMI,QAAQ,GAAG,SAAXA,QAAQA,GAAS;AACtB,EAAA,IAAIC,KAAK,CAAA;AACT;AACAA,EAAAA,KAAK,GAAG,OAAOC,MAAM,KAAK,WAAW,GAAGC,YAAY,CAACC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,CAAA;AAC1E;AACA;AACA;AACA;AACA,EAAA,OAAOH,KAAK,CAAA;AACb,CAAC,CAAA;IAEYI,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EAStB;AAAA,EAAA,IARLC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,UAAU,GAAAF,IAAA,CAAVE,UAAU;IACVC,YAAY,GAAAH,IAAA,CAAZG,YAAY;IACZC,iBAAiB,GAAAJ,IAAA,CAAjBI,iBAAiB;IACjBC,mBAAmB,GAAAL,IAAA,CAAnBK,mBAAmB;IACnBC,IAAI,GAAAN,IAAA,CAAJM,IAAI;IACJC,UAAU,GAAAP,IAAA,CAAVO,UAAU;IACVC,UAAU,GAAAR,IAAA,CAAVQ,UAAU,CAAA;AAEV;AACA;EACA,IAAAC,SAAA,GAAsCC,QAAQ,CAACC,gBAAgB,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAAAC,UAAA,GAAAC,cAAA,CAAAJ,SAAA,EAAA,CAAA,CAAA;AAAzEK,IAAAA,WAAW,G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AChBQ,MAAAA,QAAQ,EAARA,QAAQ;AACR/B,MAAAA,KAAK,EAALA,KAAK;AACLgF,MAAAA,sBAAsB,EAAtBA,sBAAsB;AACtB7C,MAAAA,QAAQ,EAARA,QAAQ;AACRO,MAAAA,eAAe,EAAfA,eAAe;AACfY,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;AACT/D,MAAAA,UAAU,EAAVA,UAAU;AACVmE,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;AAClB1C,MAAAA,iBAAiB,EAAjBA,iBAAiB;AACjBC,MAAAA,mBAAmB,EAAnBA,mBAAmB;AACnBC,MAAAA,IAAI,EAAJA,IAAI;AACJC,MAAAA,UAAU,EAAVA,UAAU;AACV0B,MAAAA,WAAW,EAAXA,WAAW;AACXC,MAAAA,cAAc,EAAdA,cAAc;AACd1B,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,\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":[],"mappings":";;;;;;AA+CA,MAAM,cAAc,GAAG,aAAa,CAAkC,SAAS,CAAC,CAAC;AAE1E,MAAM,UAAU,GAAG,MAAK;AAC9B,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAI,CAAC,OAAO,EAAE;AACb,QAAA,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;AACpE,KAAA;AACD,IAAA,OAAO,OAAO,CAAC;AAChB,EAAE;AAEF,MAAM,QAAQ,GAAG,MAAoB;IACpC,IAAI,KAAK,GAAkB,IAAI,CAAC;AAChC,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AAClC,QAAA,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACtC,KAAA;AACD,IAAA,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AAcW,MAAA,eAAe,GAAmC,CAAC,EAC/D,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,IAAI,EACJ,UAAU,EACV,UAAU,EACV,QAAQ,GAAG,EAAE,EACb,KAAI;AACJ,IAAA,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAY,gBAAgB,CAAC,UAAU,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACxG,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAY,EAAE,CAAC,CAAC;IACxE,MAAM,CAAC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enerator, regeneratorRuntime as _regeneratorRuntime } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import api from '../apis/hcApi.js';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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.
|
|
1
|
+
{"version":3,"file":"configService.js","sources":["../../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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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.
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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.
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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.
|
|
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
|
|
2
|
-
import api from './apis/hcApi.js';
|
|
1
|
+
import api from '../apis/hcApi.js';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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 {
|
|
29
|
+
export { getListings };
|
|
64
30
|
//# sourceMappingURL=listingService.js.map
|