@abcagency/hc-ui-components 1.9.7 → 1.9.8
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/components/containers/filter/search-container.js +5 -1
- package/dist/components/containers/filter/search-container.js.map +1 -1
- package/dist/contexts/mapListContext.js +8 -2
- package/dist/contexts/mapListContext.js.map +1 -1
- package/package.json +1 -1
- package/src/components/containers/filter/search-container.js +4 -1
- package/src/contexts/mapListContext.tsx +10 -2
- package/src/services/configService.ts +0 -16
- package/src/services/listingAggregatorService.ts +0 -66
- package/src/services/listingEntityService.ts +0 -16
- package/src/services/listingService.ts +0 -30
- package/src/services/recruiterService.ts +0 -18
|
@@ -41,8 +41,12 @@ var SearchContainer = function SearchContainer(_ref) {
|
|
|
41
41
|
setInputValue("");
|
|
42
42
|
setQuery("");
|
|
43
43
|
};
|
|
44
|
+
|
|
45
|
+
// Update input value when query changes from context (e.g., loaded from URL or localStorage)
|
|
44
46
|
useEffect(function () {
|
|
45
|
-
if (query
|
|
47
|
+
if (query !== null && query !== inputValue) {
|
|
48
|
+
setInputValue(query);
|
|
49
|
+
} else if (query === null || query === "") {
|
|
46
50
|
setInputValue("");
|
|
47
51
|
}
|
|
48
52
|
}, [query]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-container.js","sources":["../../../../src/components/containers/filter/search-container.js"],"sourcesContent":["import React, { useRef, useState, useEffect } from 'react';\nimport { useMapList } from '~/contexts/mapListContext';\nimport Search from '~/components/modules/filter/search';\n\nconst SearchContainer = ({\n\tinputPlaceholder = \"Keywords\",\n\tshowSearchIcon = false,\n\tclassName,\n\tlabelClassName\n}) => {\n\tconst { query, setQuery, siteConfig } = useMapList();\n\tconst [inputValue, setInputValue] = useState(query != null ? query : \"\");\n\tconst debounceTimer = useRef(null);\n\n\tconst handleInputChange = e => {\n\t\tsetInputValue(e.target.value);\n\t\tif (debounceTimer.current) {\n\t\t\tclearTimeout(debounceTimer.current);\n\t\t}\n\t\tdebounceTimer.current = setTimeout(() => {\n\t\t\tsetQuery(e.target.value);\n\t\t}, 500);\n\t};\n\n\tconst handleSubmitInput = value => {\n\t\tsetInputValue(value);\n\t\tif (debounceTimer.current) {\n\t\t\tclearTimeout(debounceTimer.current);\n\t\t}\n\t\tdebounceTimer.current = setTimeout(() => {\n\t\t\tsetQuery(value);\n\t\t}, 500);\n\t};\n\n\tconst handleReset = () => {\n\t\tsetInputValue(\"\");\n\t\tsetQuery(\"\");\n\t};\n\n\tuseEffect(() => {\n\t\tif (query
|
|
1
|
+
{"version":3,"file":"search-container.js","sources":["../../../../src/components/containers/filter/search-container.js"],"sourcesContent":["import React, { useRef, useState, useEffect } from 'react';\nimport { useMapList } from '~/contexts/mapListContext';\nimport Search from '~/components/modules/filter/search';\n\nconst SearchContainer = ({\n\tinputPlaceholder = \"Keywords\",\n\tshowSearchIcon = false,\n\tclassName,\n\tlabelClassName\n}) => {\n\tconst { query, setQuery, siteConfig } = useMapList();\n\tconst [inputValue, setInputValue] = useState(query != null ? query : \"\");\n\tconst debounceTimer = useRef(null);\n\n\tconst handleInputChange = e => {\n\t\tsetInputValue(e.target.value);\n\t\tif (debounceTimer.current) {\n\t\t\tclearTimeout(debounceTimer.current);\n\t\t}\n\t\tdebounceTimer.current = setTimeout(() => {\n\t\t\tsetQuery(e.target.value);\n\t\t}, 500);\n\t};\n\n\tconst handleSubmitInput = value => {\n\t\tsetInputValue(value);\n\t\tif (debounceTimer.current) {\n\t\t\tclearTimeout(debounceTimer.current);\n\t\t}\n\t\tdebounceTimer.current = setTimeout(() => {\n\t\t\tsetQuery(value);\n\t\t}, 500);\n\t};\n\n\tconst handleReset = () => {\n\t\tsetInputValue(\"\");\n\t\tsetQuery(\"\");\n\t};\n\n\t// Update input value when query changes from context (e.g., loaded from URL or localStorage)\n\tuseEffect(() => {\n\t\tif (query !== null && query !== inputValue) {\n\t\t\tsetInputValue(query);\n\t\t} else if (query === null || query === \"\") {\n\t\t\tsetInputValue(\"\");\n\t\t}\n\t}, [query]);\n\n\treturn (\n\t\t<Search\n\t\t\tinputPlaceholder={siteConfig.searchConfig.placeholder || inputPlaceholder}\n\t\t\tshowSearchIcon={showSearchIcon}\n\t\t\tclassName={className}\n\t\t\tlabelClassName={labelClassName}\n\t\t\tinputValue={inputValue}\n\t\t\thandleInputChange={handleInputChange}\n\t\t\thandleReset={handleReset}\n\t\t\tlabel={siteConfig.searchConfig.label}\n\t\t\thandleSubmitInput={handleSubmitInput}\n\t\t/>\n\t);\n};\n\nexport default SearchContainer;\n"],"names":["SearchContainer","_ref","_ref$inputPlaceholder","inputPlaceholder","_ref$showSearchIcon","showSearchIcon","className","labelClassName","_useMapList","useMapList","query","setQuery","siteConfig","_useState","useState","_useState2","_slicedToArray","inputValue","setInputValue","debounceTimer","useRef","handleInputChange","e","target","value","current","clearTimeout","setTimeout","handleSubmitInput","handleReset","useEffect","React","createElement","Search","searchConfig","placeholder","label"],"mappings":";;;;;AAIA,IAAMA,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EAKf;AAAA,EAAA,IAAAC,qBAAA,GAAAD,IAAA,CAJLE,gBAAgB;AAAhBA,IAAAA,gBAAgB,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,UAAU,GAAAA,qBAAA;IAAAE,mBAAA,GAAAH,IAAA,CAC7BI,cAAc;AAAdA,IAAAA,cAAc,GAAAD,mBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,mBAAA;IACtBE,SAAS,GAAAL,IAAA,CAATK,SAAS;IACTC,cAAc,GAAAN,IAAA,CAAdM,cAAc,CAAA;AAEd,EAAA,IAAAC,WAAA,GAAwCC,UAAU,EAAE;IAA5CC,KAAK,GAAAF,WAAA,CAALE,KAAK;IAAEC,QAAQ,GAAAH,WAAA,CAARG,QAAQ;IAAEC,UAAU,GAAAJ,WAAA,CAAVI,UAAU,CAAA;EACnC,IAAAC,SAAA,GAAoCC,QAAQ,CAACJ,KAAK,IA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,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAKO,UAAU,EAAE;MAC3CC,aAAa,CAACR,KAAK,CAAC,CAAA;KACpB,MAAM,IAAIA,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAK,EAAE,EAAE;MAC1CQ,aAAa,CAAC,EAAE,CAAC,CAAA;AAClB,KAAA;AACD,GAAC,EAAE,CAACR,KAAK,CAAC,CAAC,CAAA;AAEX,EAAA,oBACCqB,KAAA,CAAAC,aAAA,CAACC,MAAM,EAAA;AACN9B,IAAAA,gBAAgB,EAAES,UAAU,CAACsB,YAAY,CAACC,WAAW,IAAIhC,gBAAiB;AAC1EE,IAAAA,cAAc,EAAEA,cAAe;AAC/BC,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,cAAc,EAAEA,cAAe;AAC/BU,IAAAA,UAAU,EAAEA,UAAW;AACvBI,IAAAA,iBAAiB,EAAEA,iBAAkB;AACrCQ,IAAAA,WAAW,EAAEA,WAAY;AACzBO,IAAAA,KAAK,EAAExB,UAAU,CAACsB,YAAY,CAACE,KAAM;AACrCR,IAAAA,iBAAiB,EAAEA,iBAAAA;AAAkB,GACrC,CAAC,CAAA;AAEJ;;;;"}
|
|
@@ -59,14 +59,20 @@ const MapListProvider = ({ children, siteConfig, googleMapsApiKey, resetFilters,
|
|
|
59
59
|
return getQuery(localStorageKey);
|
|
60
60
|
// Check URL first
|
|
61
61
|
const urlData = filtersFromURL(window.location);
|
|
62
|
-
// If ls-ignore=true is in URL, don't
|
|
62
|
+
// If ls-ignore=true is in URL, ONLY use URL query (don't fall back to localStorage)
|
|
63
63
|
if (urlData?.lsIgnore) {
|
|
64
64
|
return urlData?.query || null;
|
|
65
65
|
}
|
|
66
|
+
// If setFiltersUrl is enabled and there's a query in URL, use it
|
|
66
67
|
if (setFiltersUrl === true && urlData?.query) {
|
|
67
68
|
return urlData.query;
|
|
68
69
|
}
|
|
69
|
-
//
|
|
70
|
+
// Only fall back to localStorage if there's NO query param in URL
|
|
71
|
+
// This prevents localStorage from overriding empty query params
|
|
72
|
+
if (setFiltersUrl === true && typeof urlData?.query !== 'undefined') {
|
|
73
|
+
return null; // URL has query param but it's empty/null
|
|
74
|
+
}
|
|
75
|
+
// Fall back to localStorage only if URL has no query param at all
|
|
70
76
|
return getQuery(localStorageKey);
|
|
71
77
|
};
|
|
72
78
|
const [allListings, setAllListings] = useState([]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapListContext.js","sources":["../../src/contexts/mapListContext.tsx"],"sourcesContent":["import React, { createContext, useState, useEffect, useContext, useRef, ReactNode } from 'react';\n\nimport { generateFilterOptions, applyFilters, filterListingsByLocation } from '~/util/filterUtil';\nimport { getStorageObject, setStorageObject } from '~/util/localStorageUtil';\nimport { updateURLWithFilters, filtersFromURL } from '~/util/urlFilterUtil';\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';\nimport { get } from 'http';\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 googleMapsApiKey?: string;\n favorites: number[];\n resetEntityFilter: () => void;\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 easyApplyUrl: string;\n easyApplyText: string;\n\tisIframe: boolean;\n sortSetting: { field: string; type: string };\n setSortSetting: (setting: { field: string; type: string }) => void;\n trackEvent: (event: string) => void;\n defaultFilters?: Record<string, any>;\n hiddenFilters?: string[];\n containerStyle?: any;\n ExpandListComponent?: React.ComponentType<{ listing: any }> | ((listing: any) => JSX.Element) | null;\n noEntities?: boolean;\n filterConfig?: {\n hideZeroResults?: boolean;\n dynamicCounts?: boolean;\n showFavorites?: boolean;\n collapsedByDefault?: boolean;\n sortAlphabetically?: boolean;\n classNames?: {\n filterContainer?: string;\n filterContent?: string;\n filterAccordion?: string;\n filterAccordionHeader?: string;\n filterAccordionContent?: string;\n filterItem?: string;\n filterItemLabel?: string;\n filterItemCheckbox?: string;\n filterItemCount?: string;\n searchInput?: string;\n resetButton?: string;\n showJobsButton?: string;\n filterFooter?: string;\n };\n };\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 = (localStorageKey: string = ''): string | null => {\n\tlet query: string | null = null;\n\tif (typeof window !== 'undefined') {\n\t\tquery = localStorage.getItem(localStorageKey + 'query');\n\t}\n\treturn query;\n};\n\ninterface MapListProviderProps {\n children: ReactNode;\n siteConfig: MapConfig;\n googleMapsApiKey?: string;\n resetFilters: boolean;\n navigateToDetails: (id: number) => void;\n navigateToEasyApply: (id: number) => void;\n Link: React.ComponentType<any>;\n linkFormat: string;\n easyApplyUrl: string;\n easyApplyText: string;\n\tisIframe: boolean;\n trackEvent: (event: string) => void;\n listings?: Listing[];\n\tentities?: ListingEntity[];\n setFiltersUrl?:boolean;\n hiddenFilters?: string[];\n handleUrlUpdate: (searchParams: string) => void;\n defaultFilters?: Record<string, any>;\n containerStyle?: any;\n\tlocalStorageKey: string;\n\tgetListingEntitiesCallback?: (origin?: string) => Promise<any>;\n ExpandListComponent?: React.ComponentType<{ listing: Listing }> | ((listing: Listing) => JSX.Element) | null;\n hideMap?: boolean;\n hideFilters?: boolean;\n noEntities?: boolean;\n filterConfig?: {\n hideZeroResults?: boolean;\n dynamicCounts?: boolean;\n showFavorites?: boolean;\n collapsedByDefault?: boolean;\n sortAlphabetically?: boolean;\n classNames?: {\n filterContainer?: string;\n filterContent?: string;\n filterAccordion?: string;\n filterAccordionHeader?: string;\n filterAccordionContent?: string;\n filterItem?: string;\n filterItemLabel?: string;\n filterItemCheckbox?: string;\n filterItemCount?: string;\n searchInput?: string;\n resetButton?: string;\n showJobsButton?: string;\n filterFooter?: string;\n };\n };\n}\n\nexport const MapListProvider: React.FC<MapListProviderProps> = ({\n\tchildren,\n\tsiteConfig,\n\tgoogleMapsApiKey,\n\tresetFilters,\n\tnavigateToDetails,\n\tnavigateToEasyApply,\n\tLink,\n\tlinkFormat,\n\teasyApplyUrl,\n\teasyApplyText,\n\tisIframe,\n\ttrackEvent,\n\tlistings = [],\n\tentities = [],\n\tsetFiltersUrl,\n\thiddenFilters,\n\thandleUrlUpdate,\n\tdefaultFilters,\n\tcontainerStyle,\n\tExpandListComponent,\n\tgetListingEntitiesCallback,\n\tlocalStorageKey,\n\thideMap = false,\n\thideFilters = false,\n\tnoEntities = false,\n\tfilterConfig = {\n\t\thideZeroResults: false,\n\t\tdynamicCounts: true,\n\t\tshowFavorites: true,\n\t\tcollapsedByDefault: false,\n\t\tsortAlphabetically: false,\n\t\tclassNames: {\n\t\t\tfilterContainer: '',\n\t\t\tfilterContent: '',\n\t\t\tfilterAccordion: '',\n\t\t\tfilterAccordionHeader: '',\n\t\t\tfilterAccordionContent: '',\n\t\t\tfilterItem: '',\n\t\t\tfilterItemLabel: '',\n\t\t\tfilterItemCheckbox: '',\n\t\t\tfilterItemCount: '',\n\t\t\tsearchInput: '',\n\t\t\tresetButton: '',\n\t\t\tshowJobsButton: '',\n\t\t\tfilterFooter: ''\n\t\t}\n\t}\n}) => {\n\tconst firstLoadFilters = () =>{\n\t\tif (typeof window === 'undefined') {\n\t\t\treturn getStorageObject(localStorageKey + 'selectedFilters', {}) || {};\n\t\t}\n\t\tlet urlData = filtersFromURL(window.location);\n\t\tlet urlFilters = urlData?.filters;\n\n\t\t// If ls-ignore=true is in URL, don't load from localStorage\n\t\tif (urlData?.lsIgnore) {\n\t\t\treturn urlFilters || {};\n\t\t}\n\n\t\treturn (setFiltersUrl === true && urlFilters && Object.keys(urlFilters).length > 0) ? urlFilters : getStorageObject(localStorageKey + 'selectedFilters', {}) || {}\n\t}\n\n\tconst firstLoadQuery = (): string | null => {\n\t\tif (resetFilters) return null;\n\t\tif (typeof window === 'undefined') return getQuery(localStorageKey);\n\t\t// Check URL first\n\t\tconst urlData = filtersFromURL(window.location);\n\n\t\t// If ls-ignore=true is in URL, don't load from localStorage\n\t\tif (urlData?.lsIgnore) {\n\t\t\treturn urlData?.query || null;\n\t\t}\n\n\t\tif (setFiltersUrl === true && urlData?.query) {\n\t\t\treturn urlData.query;\n\t\t}\n\t\t// Fall back to localStorage\n\t\treturn getQuery(localStorageKey);\n\t}\n\n\tconst [allListings, setAllListings] = useState<Listing[]>([]);\n\tconst [filteredListings, setFilteredListings] = useState<Listing[]>([]);\n\tconst [loading, setLoading] = useState<boolean>(false);\n\tconst [mapItems, setMapItems] = useState<any>([]);\n\tconst [query, setQuery] = useState<string | null>(null);\n\tconst [sortSetting, setSortSetting] = useState<{ field: string; type: string }>({ field: 'position', type: 'asc' });\n\tconst [listingEntities, setListingEntities] = useState<Record<number, ListingEntity> | null>({});\n\tconst [firstLoad, setFirstLoad] = useState<boolean>(true);\n\tconst [commuteLocation, setCommuteLocation] = useState<any | null>(null);\n\tconst [selectedFilters, setSelectedFilters] = useState<Record<string, any>>({});\n\tconst [hasMounted, setHasMounted] = useState(false);\n\n\t// Load from localStorage/URL after mount to avoid hydration mismatch\n\tuseEffect(() => {\n\t\tif (typeof window !== 'undefined') {\n\t\t\tconst storedMapItems = getStorageObject(localStorageKey + 'mapItems', []) || [];\n\t\t\tconst storedSortSetting = getStorageObject(localStorageKey + 'sortSetting', { field: 'position', type: 'asc' }) || { field: 'position', type: 'asc' };\n\t\t\tconst storedCommuteLocation = getStorageObject(localStorageKey + 'commuteLocation');\n\t\t\t\n\t\t\tsetMapItems(storedMapItems);\n\t\t\tsetSortSetting(storedSortSetting);\n\t\t\tif (storedCommuteLocation) setCommuteLocation(storedCommuteLocation);\n\t\t\t\n\t\t\t// Load filters and query\n\t\t\tif (!resetFilters) {\n\t\t\t\tsetSelectedFilters(firstLoadFilters());\n\t\t\t\tsetQuery(firstLoadQuery());\n\t\t\t}\n\t\t\t\n\t\t\tsetHasMounted(true);\n\t\t}\n\t}, [localStorageKey]);\n\tconst [filterOptions, setFilterOptions] = useState<any>();\n\tconst [recruiters, setRecruiters] = useState<Record<number, Recruiter>>({});\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\tconst entitiesInitialized = useRef<boolean>(false);\n\n\tconst setNewFilteredListings = (filteredListings: Listing[]) => {\n\t\tsetFilteredListings(filteredListings);\n\t};\n\n\tuseEffect(() => {\n\t\tif (!sortSetting) return;\n\t\tif (typeof window !== 'undefined') {\n\t\t\tlocalStorage.setItem(localStorageKey + 'sortSetting', JSON.stringify(sortSetting));\n\t\t}\n\t}, [sortSetting, localStorageKey]);\n\n\tuseEffect(() => {\n\t\tif (typeof window === 'undefined') return;\n\t\tconst loadedFavorites = JSON.parse(localStorage.getItem(localStorageKey + 'favorites') || '[]');\n\t\tsetFavorites(loadedFavorites);\n\t}, [localStorageKey]);\n\n\tuseEffect(() => {\n\t\tsetStorageObject(localStorageKey + \"commuteLocation\", commuteLocation);\n\t}, [commuteLocation, localStorageKey]);\n\n\n\tuseEffect(() => {\n\t\tif (!commuteLocation || noEntities) return;\n\n\t\tasync function fetchEntities() {\n\t\t\ttry {\n\t\t\t\t// Only fetch if callback is provided\n\t\t\t\tif (!getListingEntitiesCallback) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tconst fetchedEntities = await getListingEntitiesCallback(`${commuteLocation.lat}, ${commuteLocation.lng}`);\n\t\t\t\tconsole.log('Fetched entities with travel times:', fetchedEntities);\n\t\t\t\tsetListingEntities(fetchedEntities);\n\t\t\t\t\n\t\t\t\t// Update travelTime on ALL listings (both allListings and filteredListings)\n\t\t\t\tconst updatedAllListings = allListings.map(listing => {\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.fields.entityKey &&\n\t\t\t\t\t\tlisting.fields.entityKey !== ''\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst entityKey = listing.fields.entityKey;\n\t\t\t\t\t\t// Try exact match first, then lowercase match for case-insensitive lookup\n\t\t\t\t\t\tconst travelTime = (fetchedEntities[entityKey] || fetchedEntities[entityKey.toLowerCase()])?.travelTime;\n\t\t\t\t\t\tif (travelTime !== undefined) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...listing,\n\t\t\t\t\t\t\t\tfields: {\n\t\t\t\t\t\t\t\t\t...listing.fields,\n\t\t\t\t\t\t\t\t\ttravelTime\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn listing;\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tconsole.log('Updated listings with travel times:', updatedAllListings.slice(0, 2));\n\t\t\t\tsetAllListings(updatedAllListings);\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, noEntities]);\n\n\t// Set listingEntities from passed-in entities (only once on initial load)\n\t// Entities should be an object: { \"rochester, mn\": {...}, \"albuquerque, nm\": {...} }\n\t// Note: Commute location changes will fetch updated entities with travel times via separate useEffect\n\tuseEffect(() => {\n\t\tif (!entities || entitiesInitialized.current) return;\n\t\t\n\t\tentitiesInitialized.current = true;\n\t\t\n\t\t// Handle both object (production format) and array (for backwards compatibility)\n\t\tif (Array.isArray(entities)) {\n\t\t\t// Convert array to object\n\t\t\tconst entitiesObj: Record<string, any> = {};\n\t\t\tentities.forEach((entity: any) => {\n\t\t\t\tif (entity.entityKey) {\n\t\t\t\t\tentitiesObj[entity.entityKey.toLowerCase()] = entity;\n\t\t\t\t}\n\t\t\t});\n\t\t\tconsole.log('Set listingEntities from entities array:', entitiesObj);\n\t\t\tsetListingEntities(entitiesObj);\n\t\t} else if (typeof entities === 'object') {\n\t\t\t// Normalize keys to lowercase for production format\n\t\t\tconst normalizedEntities: Record<string, any> = {};\n\t\t\tObject.keys(entities).forEach(key => {\n\t\t\t\tnormalizedEntities[key.toLowerCase()] = entities[key];\n\t\t\t});\n\t\t\tconsole.log('Set listingEntities from entities object:', normalizedEntities);\n\t\t\tsetListingEntities(normalizedEntities);\n\t\t}\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []); // Empty deps - only run once on mount, entities are static data\n\n\t// Set listings from passed-in data\n\tuseEffect(() => {\n\t\tif (!listings || listings.length === 0) {\n\t\t\tsetLoading(false);\n\t\t\treturn;\n\t\t}\n\n\t\tsetLoading(true);\n\n\t\ttry {\n\t\t\t// Apply default filters if provided\n\t\t\tlet processedListings = listings;\n\t\t\tif (defaultFilters) {\n\t\t\t\tprocessedListings = listings.filter(listing => {\n\t\t\t\t\tif (!listing.fields) return false;\n\n\t\t\t\t\treturn Object.keys(defaultFilters).every(filterKey => {\n\t\t\t\t\t\tconst filterValues = defaultFilters[filterKey as keyof typeof defaultFilters];\n\t\t\t\t\t\tconst listingValue = listing.fields ? listing.fields[filterKey as keyof typeof listing.fields] : null;\n\t\t\t\t\t\treturn filterValues.includes(listingValue);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tsetAllListings(processedListings);\n\t\t\tconsole.log('Set allListings to', processedListings.length, 'items');\n\t\t\t\n\t\t\t// Map items will be set when entities are processed\n\t\t\t// For now, just set empty object - will be populated when entities arrive\n\t\t\tsetMapItems({});\n\t\t} catch (error) {\n\t\t\tconsole.error('Error processing listings:', error);\n\t\t}\n\t\t\n\t\tsetLoading(false);\n\t}, [listings]);\n\n\tuseEffect(() => {\n\t\tconst processListings = async () => {\n\t\t\t// Don't process if allListings hasn't been loaded yet\n\t\t\tif (allListings.length === 0) {\n\t\t\t\tconsole.log('processListings: Skipping - allListings is empty');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet filteredListings: Listing[];\n\t\t\tlet tempSelectedFilters = selectedFilters;\n\t\t\tlet tempQuery = query;\n\n\t\t\tconsole.log('processListings: Running with query:', tempQuery, 'and', allListings.length, 'listings');\n\n\t\t\tconst { mapItems, filteredListings: tempFilteredListings } = await applyFilters(\n\t\t\t\tallListings,\n\t\t\t\ttempSelectedFilters,\n\t\t\t\ttempQuery,\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\n\t\t\t// Batch state updates together\n\t\t\tsetNewFilteredListings(filteredListings);\n\t\t\tsetMapItems(mapItems);\n\n\t\t\tif (firstLoad && tempSelectedFilters) {\n\t\t\t\t// Update URL with filters if needed\n\t\t\t} else if (Object.keys(tempSelectedFilters).length === 0 && !firstLoad) {\n\t\t\t\tlocalStorage.removeItem(localStorageKey + 'selectedFilters');\n\t\t\t} else if (!firstLoad) {\n\t\t\t\tsetStorageObject(localStorageKey + 'selectedFilters', tempSelectedFilters);\n\t\t\t}\n\t\t\tif(setFiltersUrl === true && typeof window !== 'undefined')\n\t\t\t{\n\t\t\t\tupdateURLWithFilters(tempSelectedFilters, window.location, tempQuery, handleUrlUpdate);\n\t\t\t}\n\t\t\tif (typeof window !== 'undefined') {\n\t\t\t\ttempQuery != null ? localStorage.setItem(localStorageKey + 'query', tempQuery) : localStorage.removeItem(localStorageKey + 'query');\n\t\t\t}\n\n\t\t\tif (tempSelectedFilters) {\n\t\t\t\tconst keys = Object.keys(tempSelectedFilters);\n\t\t\t\tconst lastKey = keys[keys.length - 1];\n\n\t\t\t\t// Ensure all filterConfig properties have values\n\t\t\t\tconst normalizedFilterConfig = {\n\t\t\t\t\thideZeroResults: filterConfig?.hideZeroResults ?? false,\n\t\t\t\t\tdynamicCounts: filterConfig?.dynamicCounts ?? true,\n\t\t\t\t\tshowFavorites: filterConfig?.showFavorites ?? true,\n\t\t\t\t\tcollapsedByDefault: filterConfig?.collapsedByDefault ?? false,\n\t\t\t\t\tsortAlphabetically: filterConfig?.sortAlphabetically ?? false,\n\t\t\t\t\tclassNames: {\n\t\t\t\t\t\tfilterContainer: filterConfig?.classNames?.filterContainer ?? '',\n\t\t\t\t\t\tfilterContent: filterConfig?.classNames?.filterContent ?? '',\n\t\t\t\t\t\tfilterAccordion: filterConfig?.classNames?.filterAccordion ?? '',\n\t\t\t\t\t\tfilterAccordionHeader: filterConfig?.classNames?.filterAccordionHeader ?? '',\n\t\t\t\t\t\tfilterAccordionContent: filterConfig?.classNames?.filterAccordionContent ?? '',\n\t\t\t\t\t\tfilterItem: filterConfig?.classNames?.filterItem ?? '',\n\t\t\t\t\t\tfilterItemLabel: filterConfig?.classNames?.filterItemLabel ?? '',\n\t\t\t\t\t\tfilterItemCheckbox: filterConfig?.classNames?.filterItemCheckbox ?? '',\n\t\t\t\t\t\tfilterItemCount: filterConfig?.classNames?.filterItemCount ?? '',\n\t\t\t\t\t\tsearchInput: filterConfig?.classNames?.searchInput ?? '',\n\t\t\t\t\t\tresetButton: filterConfig?.classNames?.resetButton ?? '',\n\t\t\t\t\t\tshowJobsButton: filterConfig?.classNames?.showJobsButton ?? '',\n\t\t\t\t\t\tfilterFooter: filterConfig?.classNames?.filterFooter ?? ''\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tconst options = generateFilterOptions(\n\t\t\t\t\tfilteredListings,\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\ttempSelectedFilters,\n\t\t\t\t\tnormalizedFilterConfig\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, filterByFavorites, favorites, allListings]);\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 resetEntityFilter = () => {\n\t\tlet newFilters = {...selectedFilters};\n\t\tdelete newFilters.entityId;\n\t\tsetSelectedFilters(newFilters);\n\t}\n\n\tconst handleSettingFavorites = (newFavorites: number[] | null) => {\n\t\tif (typeof window === 'undefined') return;\n\t\tif (newFavorites == null) {\n\t\t\tlocalStorage.removeItem(localStorageKey + 'favorites');\n\t\t} else {\n\t\t\tsetFavorites(newFavorites);\n\t\t\tlocalStorage.setItem(localStorageKey + '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\tgoogleMapsApiKey,\n\t\t\tfavorites,\n\t\t\thandleSettingFavorites,\n\t\t\tresetEntityFilter,\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\teasyApplyUrl,\n\t\t\teasyApplyText,\n\t\t\tisIframe,\n\t\t\tsortSetting,\n\t\t\tsetSortSetting,\n\t\t\ttrackEvent,\n\t\t\tdefaultFilters,\n\t\t\thiddenFilters,\n\t\t\tcontainerStyle,\n\t\t\tExpandListComponent,\n\t\t\tnoEntities,\n\t\t\tfilterConfig\n\t\t}}>\n\t\t\t{children}\n\t\t</MapListContext.Provider>\n\t);\n};\n"],"names":[],"mappings":";;;;;AA8EA,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,CAAC,eAA0B,GAAA,EAAE,KAAmB;IAChE,IAAI,KAAK,GAAkB,IAAI,CAAC;AAChC,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QAClC,KAAK,GAAG,YAAY,CAAC,OAAO,CAA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e;YACf,kBAAkB;YAClB,aAAa;YACb,UAAU;YACV,8BAA8B;YAC9B,kBAAkB;YAClB,qBAAqB;YACrB,YAAY;YACZ,SAAS;YACT,UAAU;YACV,gBAAgB;YAChB,SAAS;YACT,sBAAsB;YACtB,iBAAiB;YACjB,oBAAoB;YACpB,iBAAiB;YACjB,eAAe;YACf,kBAAkB;YAClB,iBAAiB;YACjB,mBAAmB;YACnB,IAAI;YACJ,UAAU;YACV,YAAY;YACZ,aAAa;YACb,QAAQ;YACR,WAAW;YACX,cAAc;YACd,UAAU;YACV,cAAc;YACd,aAAa;YACb,cAAc;YACd,mBAAmB;YACnB,UAAU;YACV,YAAY;SACZ,EACC,EAAA,QAAQ,CACgB,EACzB;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"mapListContext.js","sources":["../../src/contexts/mapListContext.tsx"],"sourcesContent":["import React, { createContext, useState, useEffect, useContext, useRef, ReactNode } from 'react';\n\nimport { generateFilterOptions, applyFilters, filterListingsByLocation } from '~/util/filterUtil';\nimport { getStorageObject, setStorageObject } from '~/util/localStorageUtil';\nimport { updateURLWithFilters, filtersFromURL } from '~/util/urlFilterUtil';\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';\nimport { get } from 'http';\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 googleMapsApiKey?: string;\n favorites: number[];\n resetEntityFilter: () => void;\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 easyApplyUrl: string;\n easyApplyText: string;\n\tisIframe: boolean;\n sortSetting: { field: string; type: string };\n setSortSetting: (setting: { field: string; type: string }) => void;\n trackEvent: (event: string) => void;\n defaultFilters?: Record<string, any>;\n hiddenFilters?: string[];\n containerStyle?: any;\n ExpandListComponent?: React.ComponentType<{ listing: any }> | ((listing: any) => JSX.Element) | null;\n noEntities?: boolean;\n filterConfig?: {\n hideZeroResults?: boolean;\n dynamicCounts?: boolean;\n showFavorites?: boolean;\n collapsedByDefault?: boolean;\n sortAlphabetically?: boolean;\n classNames?: {\n filterContainer?: string;\n filterContent?: string;\n filterAccordion?: string;\n filterAccordionHeader?: string;\n filterAccordionContent?: string;\n filterItem?: string;\n filterItemLabel?: string;\n filterItemCheckbox?: string;\n filterItemCount?: string;\n searchInput?: string;\n resetButton?: string;\n showJobsButton?: string;\n filterFooter?: string;\n };\n };\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 = (localStorageKey: string = ''): string | null => {\n\tlet query: string | null = null;\n\tif (typeof window !== 'undefined') {\n\t\tquery = localStorage.getItem(localStorageKey + 'query');\n\t}\n\treturn query;\n};\n\ninterface MapListProviderProps {\n children: ReactNode;\n siteConfig: MapConfig;\n googleMapsApiKey?: string;\n resetFilters: boolean;\n navigateToDetails: (id: number) => void;\n navigateToEasyApply: (id: number) => void;\n Link: React.ComponentType<any>;\n linkFormat: string;\n easyApplyUrl: string;\n easyApplyText: string;\n\tisIframe: boolean;\n trackEvent: (event: string) => void;\n listings?: Listing[];\n\tentities?: ListingEntity[];\n setFiltersUrl?:boolean;\n hiddenFilters?: string[];\n handleUrlUpdate: (searchParams: string) => void;\n defaultFilters?: Record<string, any>;\n containerStyle?: any;\n\tlocalStorageKey: string;\n\tgetListingEntitiesCallback?: (origin?: string) => Promise<any>;\n ExpandListComponent?: React.ComponentType<{ listing: Listing }> | ((listing: Listing) => JSX.Element) | null;\n hideMap?: boolean;\n hideFilters?: boolean;\n noEntities?: boolean;\n filterConfig?: {\n hideZeroResults?: boolean;\n dynamicCounts?: boolean;\n showFavorites?: boolean;\n collapsedByDefault?: boolean;\n sortAlphabetically?: boolean;\n classNames?: {\n filterContainer?: string;\n filterContent?: string;\n filterAccordion?: string;\n filterAccordionHeader?: string;\n filterAccordionContent?: string;\n filterItem?: string;\n filterItemLabel?: string;\n filterItemCheckbox?: string;\n filterItemCount?: string;\n searchInput?: string;\n resetButton?: string;\n showJobsButton?: string;\n filterFooter?: string;\n };\n };\n}\n\nexport const MapListProvider: React.FC<MapListProviderProps> = ({\n\tchildren,\n\tsiteConfig,\n\tgoogleMapsApiKey,\n\tresetFilters,\n\tnavigateToDetails,\n\tnavigateToEasyApply,\n\tLink,\n\tlinkFormat,\n\teasyApplyUrl,\n\teasyApplyText,\n\tisIframe,\n\ttrackEvent,\n\tlistings = [],\n\tentities = [],\n\tsetFiltersUrl,\n\thiddenFilters,\n\thandleUrlUpdate,\n\tdefaultFilters,\n\tcontainerStyle,\n\tExpandListComponent,\n\tgetListingEntitiesCallback,\n\tlocalStorageKey,\n\thideMap = false,\n\thideFilters = false,\n\tnoEntities = false,\n\tfilterConfig = {\n\t\thideZeroResults: false,\n\t\tdynamicCounts: true,\n\t\tshowFavorites: true,\n\t\tcollapsedByDefault: false,\n\t\tsortAlphabetically: false,\n\t\tclassNames: {\n\t\t\tfilterContainer: '',\n\t\t\tfilterContent: '',\n\t\t\tfilterAccordion: '',\n\t\t\tfilterAccordionHeader: '',\n\t\t\tfilterAccordionContent: '',\n\t\t\tfilterItem: '',\n\t\t\tfilterItemLabel: '',\n\t\t\tfilterItemCheckbox: '',\n\t\t\tfilterItemCount: '',\n\t\t\tsearchInput: '',\n\t\t\tresetButton: '',\n\t\t\tshowJobsButton: '',\n\t\t\tfilterFooter: ''\n\t\t}\n\t}\n}) => {\n\tconst firstLoadFilters = () =>{\n\t\tif (typeof window === 'undefined') {\n\t\t\treturn getStorageObject(localStorageKey + 'selectedFilters', {}) || {};\n\t\t}\n\t\tlet urlData = filtersFromURL(window.location);\n\t\tlet urlFilters = urlData?.filters;\n\n\t\t// If ls-ignore=true is in URL, don't load from localStorage\n\t\tif (urlData?.lsIgnore) {\n\t\t\treturn urlFilters || {};\n\t\t}\n\n\t\treturn (setFiltersUrl === true && urlFilters && Object.keys(urlFilters).length > 0) ? urlFilters : getStorageObject(localStorageKey + 'selectedFilters', {}) || {}\n\t}\n\n\tconst firstLoadQuery = (): string | null => {\n\t\tif (resetFilters) return null;\n\t\tif (typeof window === 'undefined') return getQuery(localStorageKey);\n\t\t// Check URL first\n\t\tconst urlData = filtersFromURL(window.location);\n\n\t\t// If ls-ignore=true is in URL, ONLY use URL query (don't fall back to localStorage)\n\t\tif (urlData?.lsIgnore) {\n\t\t\treturn urlData?.query || null;\n\t\t}\n\n\t\t// If setFiltersUrl is enabled and there's a query in URL, use it\n\t\tif (setFiltersUrl === true && urlData?.query) {\n\t\t\treturn urlData.query;\n\t\t}\n\t\t\n\t\t// Only fall back to localStorage if there's NO query param in URL\n\t\t// This prevents localStorage from overriding empty query params\n\t\tif (setFiltersUrl === true && typeof urlData?.query !== 'undefined') {\n\t\t\treturn null; // URL has query param but it's empty/null\n\t\t}\n\t\t\n\t\t// Fall back to localStorage only if URL has no query param at all\n\t\treturn getQuery(localStorageKey);\n\t}\n\n\tconst [allListings, setAllListings] = useState<Listing[]>([]);\n\tconst [filteredListings, setFilteredListings] = useState<Listing[]>([]);\n\tconst [loading, setLoading] = useState<boolean>(false);\n\tconst [mapItems, setMapItems] = useState<any>([]);\n\tconst [query, setQuery] = useState<string | null>(null);\n\tconst [sortSetting, setSortSetting] = useState<{ field: string; type: string }>({ field: 'position', type: 'asc' });\n\tconst [listingEntities, setListingEntities] = useState<Record<number, ListingEntity> | null>({});\n\tconst [firstLoad, setFirstLoad] = useState<boolean>(true);\n\tconst [commuteLocation, setCommuteLocation] = useState<any | null>(null);\n\tconst [selectedFilters, setSelectedFilters] = useState<Record<string, any>>({});\n\tconst [hasMounted, setHasMounted] = useState(false);\n\n\t// Load from localStorage/URL after mount to avoid hydration mismatch\n\tuseEffect(() => {\n\t\tif (typeof window !== 'undefined') {\n\t\t\tconst storedMapItems = getStorageObject(localStorageKey + 'mapItems', []) || [];\n\t\t\tconst storedSortSetting = getStorageObject(localStorageKey + 'sortSetting', { field: 'position', type: 'asc' }) || { field: 'position', type: 'asc' };\n\t\t\tconst storedCommuteLocation = getStorageObject(localStorageKey + 'commuteLocation');\n\t\t\t\n\t\t\tsetMapItems(storedMapItems);\n\t\t\tsetSortSetting(storedSortSetting);\n\t\t\tif (storedCommuteLocation) setCommuteLocation(storedCommuteLocation);\n\t\t\t\n\t\t\t// Load filters and query\n\t\t\tif (!resetFilters) {\n\t\t\t\tsetSelectedFilters(firstLoadFilters());\n\t\t\t\tsetQuery(firstLoadQuery());\n\t\t\t}\n\t\t\t\n\t\t\tsetHasMounted(true);\n\t\t}\n\t}, [localStorageKey]);\n\tconst [filterOptions, setFilterOptions] = useState<any>();\n\tconst [recruiters, setRecruiters] = useState<Record<number, Recruiter>>({});\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\tconst entitiesInitialized = useRef<boolean>(false);\n\n\tconst setNewFilteredListings = (filteredListings: Listing[]) => {\n\t\tsetFilteredListings(filteredListings);\n\t};\n\n\tuseEffect(() => {\n\t\tif (!sortSetting) return;\n\t\tif (typeof window !== 'undefined') {\n\t\t\tlocalStorage.setItem(localStorageKey + 'sortSetting', JSON.stringify(sortSetting));\n\t\t}\n\t}, [sortSetting, localStorageKey]);\n\n\tuseEffect(() => {\n\t\tif (typeof window === 'undefined') return;\n\t\tconst loadedFavorites = JSON.parse(localStorage.getItem(localStorageKey + 'favorites') || '[]');\n\t\tsetFavorites(loadedFavorites);\n\t}, [localStorageKey]);\n\n\tuseEffect(() => {\n\t\tsetStorageObject(localStorageKey + \"commuteLocation\", commuteLocation);\n\t}, [commuteLocation, localStorageKey]);\n\n\n\tuseEffect(() => {\n\t\tif (!commuteLocation || noEntities) return;\n\n\t\tasync function fetchEntities() {\n\t\t\ttry {\n\t\t\t\t// Only fetch if callback is provided\n\t\t\t\tif (!getListingEntitiesCallback) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tconst fetchedEntities = await getListingEntitiesCallback(`${commuteLocation.lat}, ${commuteLocation.lng}`);\n\t\t\t\tconsole.log('Fetched entities with travel times:', fetchedEntities);\n\t\t\t\tsetListingEntities(fetchedEntities);\n\t\t\t\t\n\t\t\t\t// Update travelTime on ALL listings (both allListings and filteredListings)\n\t\t\t\tconst updatedAllListings = allListings.map(listing => {\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.fields.entityKey &&\n\t\t\t\t\t\tlisting.fields.entityKey !== ''\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst entityKey = listing.fields.entityKey;\n\t\t\t\t\t\t// Try exact match first, then lowercase match for case-insensitive lookup\n\t\t\t\t\t\tconst travelTime = (fetchedEntities[entityKey] || fetchedEntities[entityKey.toLowerCase()])?.travelTime;\n\t\t\t\t\t\tif (travelTime !== undefined) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...listing,\n\t\t\t\t\t\t\t\tfields: {\n\t\t\t\t\t\t\t\t\t...listing.fields,\n\t\t\t\t\t\t\t\t\ttravelTime\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn listing;\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tconsole.log('Updated listings with travel times:', updatedAllListings.slice(0, 2));\n\t\t\t\tsetAllListings(updatedAllListings);\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, noEntities]);\n\n\t// Set listingEntities from passed-in entities (only once on initial load)\n\t// Entities should be an object: { \"rochester, mn\": {...}, \"albuquerque, nm\": {...} }\n\t// Note: Commute location changes will fetch updated entities with travel times via separate useEffect\n\tuseEffect(() => {\n\t\tif (!entities || entitiesInitialized.current) return;\n\t\t\n\t\tentitiesInitialized.current = true;\n\t\t\n\t\t// Handle both object (production format) and array (for backwards compatibility)\n\t\tif (Array.isArray(entities)) {\n\t\t\t// Convert array to object\n\t\t\tconst entitiesObj: Record<string, any> = {};\n\t\t\tentities.forEach((entity: any) => {\n\t\t\t\tif (entity.entityKey) {\n\t\t\t\t\tentitiesObj[entity.entityKey.toLowerCase()] = entity;\n\t\t\t\t}\n\t\t\t});\n\t\t\tconsole.log('Set listingEntities from entities array:', entitiesObj);\n\t\t\tsetListingEntities(entitiesObj);\n\t\t} else if (typeof entities === 'object') {\n\t\t\t// Normalize keys to lowercase for production format\n\t\t\tconst normalizedEntities: Record<string, any> = {};\n\t\t\tObject.keys(entities).forEach(key => {\n\t\t\t\tnormalizedEntities[key.toLowerCase()] = entities[key];\n\t\t\t});\n\t\t\tconsole.log('Set listingEntities from entities object:', normalizedEntities);\n\t\t\tsetListingEntities(normalizedEntities);\n\t\t}\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []); // Empty deps - only run once on mount, entities are static data\n\n\t// Set listings from passed-in data\n\tuseEffect(() => {\n\t\tif (!listings || listings.length === 0) {\n\t\t\tsetLoading(false);\n\t\t\treturn;\n\t\t}\n\n\t\tsetLoading(true);\n\n\t\ttry {\n\t\t\t// Apply default filters if provided\n\t\t\tlet processedListings = listings;\n\t\t\tif (defaultFilters) {\n\t\t\t\tprocessedListings = listings.filter(listing => {\n\t\t\t\t\tif (!listing.fields) return false;\n\n\t\t\t\t\treturn Object.keys(defaultFilters).every(filterKey => {\n\t\t\t\t\t\tconst filterValues = defaultFilters[filterKey as keyof typeof defaultFilters];\n\t\t\t\t\t\tconst listingValue = listing.fields ? listing.fields[filterKey as keyof typeof listing.fields] : null;\n\t\t\t\t\t\treturn filterValues.includes(listingValue);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tsetAllListings(processedListings);\n\t\t\tconsole.log('Set allListings to', processedListings.length, 'items');\n\t\t\t\n\t\t\t// Map items will be set when entities are processed\n\t\t\t// For now, just set empty object - will be populated when entities arrive\n\t\t\tsetMapItems({});\n\t\t} catch (error) {\n\t\t\tconsole.error('Error processing listings:', error);\n\t\t}\n\t\t\n\t\tsetLoading(false);\n\t}, [listings]);\n\n\tuseEffect(() => {\n\t\tconst processListings = async () => {\n\t\t\t// Don't process if allListings hasn't been loaded yet\n\t\t\tif (allListings.length === 0) {\n\t\t\t\tconsole.log('processListings: Skipping - allListings is empty');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet filteredListings: Listing[];\n\t\t\tlet tempSelectedFilters = selectedFilters;\n\t\t\tlet tempQuery = query;\n\n\t\t\tconsole.log('processListings: Running with query:', tempQuery, 'and', allListings.length, 'listings');\n\n\t\t\tconst { mapItems, filteredListings: tempFilteredListings } = await applyFilters(\n\t\t\t\tallListings,\n\t\t\t\ttempSelectedFilters,\n\t\t\t\ttempQuery,\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\n\t\t\t// Batch state updates together\n\t\t\tsetNewFilteredListings(filteredListings);\n\t\t\tsetMapItems(mapItems);\n\n\t\t\tif (firstLoad && tempSelectedFilters) {\n\t\t\t\t// Update URL with filters if needed\n\t\t\t} else if (Object.keys(tempSelectedFilters).length === 0 && !firstLoad) {\n\t\t\t\tlocalStorage.removeItem(localStorageKey + 'selectedFilters');\n\t\t\t} else if (!firstLoad) {\n\t\t\t\tsetStorageObject(localStorageKey + 'selectedFilters', tempSelectedFilters);\n\t\t\t}\n\t\t\tif(setFiltersUrl === true && typeof window !== 'undefined')\n\t\t\t{\n\t\t\t\tupdateURLWithFilters(tempSelectedFilters, window.location, tempQuery, handleUrlUpdate);\n\t\t\t}\n\t\t\tif (typeof window !== 'undefined') {\n\t\t\t\ttempQuery != null ? localStorage.setItem(localStorageKey + 'query', tempQuery) : localStorage.removeItem(localStorageKey + 'query');\n\t\t\t}\n\n\t\t\tif (tempSelectedFilters) {\n\t\t\t\tconst keys = Object.keys(tempSelectedFilters);\n\t\t\t\tconst lastKey = keys[keys.length - 1];\n\n\t\t\t\t// Ensure all filterConfig properties have values\n\t\t\t\tconst normalizedFilterConfig = {\n\t\t\t\t\thideZeroResults: filterConfig?.hideZeroResults ?? false,\n\t\t\t\t\tdynamicCounts: filterConfig?.dynamicCounts ?? true,\n\t\t\t\t\tshowFavorites: filterConfig?.showFavorites ?? true,\n\t\t\t\t\tcollapsedByDefault: filterConfig?.collapsedByDefault ?? false,\n\t\t\t\t\tsortAlphabetically: filterConfig?.sortAlphabetically ?? false,\n\t\t\t\t\tclassNames: {\n\t\t\t\t\t\tfilterContainer: filterConfig?.classNames?.filterContainer ?? '',\n\t\t\t\t\t\tfilterContent: filterConfig?.classNames?.filterContent ?? '',\n\t\t\t\t\t\tfilterAccordion: filterConfig?.classNames?.filterAccordion ?? '',\n\t\t\t\t\t\tfilterAccordionHeader: filterConfig?.classNames?.filterAccordionHeader ?? '',\n\t\t\t\t\t\tfilterAccordionContent: filterConfig?.classNames?.filterAccordionContent ?? '',\n\t\t\t\t\t\tfilterItem: filterConfig?.classNames?.filterItem ?? '',\n\t\t\t\t\t\tfilterItemLabel: filterConfig?.classNames?.filterItemLabel ?? '',\n\t\t\t\t\t\tfilterItemCheckbox: filterConfig?.classNames?.filterItemCheckbox ?? '',\n\t\t\t\t\t\tfilterItemCount: filterConfig?.classNames?.filterItemCount ?? '',\n\t\t\t\t\t\tsearchInput: filterConfig?.classNames?.searchInput ?? '',\n\t\t\t\t\t\tresetButton: filterConfig?.classNames?.resetButton ?? '',\n\t\t\t\t\t\tshowJobsButton: filterConfig?.classNames?.showJobsButton ?? '',\n\t\t\t\t\t\tfilterFooter: filterConfig?.classNames?.filterFooter ?? ''\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tconst options = generateFilterOptions(\n\t\t\t\t\tfilteredListings,\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\ttempSelectedFilters,\n\t\t\t\t\tnormalizedFilterConfig\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, filterByFavorites, favorites, allListings]);\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 resetEntityFilter = () => {\n\t\tlet newFilters = {...selectedFilters};\n\t\tdelete newFilters.entityId;\n\t\tsetSelectedFilters(newFilters);\n\t}\n\n\tconst handleSettingFavorites = (newFavorites: number[] | null) => {\n\t\tif (typeof window === 'undefined') return;\n\t\tif (newFavorites == null) {\n\t\t\tlocalStorage.removeItem(localStorageKey + 'favorites');\n\t\t} else {\n\t\t\tsetFavorites(newFavorites);\n\t\t\tlocalStorage.setItem(localStorageKey + '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\tgoogleMapsApiKey,\n\t\t\tfavorites,\n\t\t\thandleSettingFavorites,\n\t\t\tresetEntityFilter,\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\teasyApplyUrl,\n\t\t\teasyApplyText,\n\t\t\tisIframe,\n\t\t\tsortSetting,\n\t\t\tsetSortSetting,\n\t\t\ttrackEvent,\n\t\t\tdefaultFilters,\n\t\t\thiddenFilters,\n\t\t\tcontainerStyle,\n\t\t\tExpandListComponent,\n\t\t\tnoEntities,\n\t\t\tfilterConfig\n\t\t}}>\n\t\t\t{children}\n\t\t</MapListContext.Provider>\n\t);\n};\n"],"names":[],"mappings":";;;;;AA8EA,MAAM,cAAc,GAAG,aAAa,CAAkC,SAAS,CAAC,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QAChE,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO;QAC1C,IAAI,YAAY,IAAI,IAAI,EAAE;AACzB,YAAA,YAAY,CAAC,UAAU,CAAC,eAAe,GAAG,WAAW,CAAC,CAAC;AACvD,SAAA;AAAM,aAAA;YACN,YAAY,CAAC,YAAY,CAAC,CAAC;AAC3B,YAAA,YAAY,CAAC,OAAO,CAAC,eAAe,GAAG,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;AAClF,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,gBAAgB;YAChB,SAAS;YACT,sBAAsB;YACtB,iBAAiB;YACjB,oBAAoB;YACpB,iBAAiB;YACjB,eAAe;YACf,kBAAkB;YAClB,iBAAiB;YACjB,mBAAmB;YACnB,IAAI;YACJ,UAAU;YACV,YAAY;YACZ,aAAa;YACb,QAAQ;YACR,WAAW;YACX,cAAc;YACd,UAAU;YACV,cAAc;YACd,aAAa;YACb,cAAc;YACd,mBAAmB;YACnB,UAAU;YACV,YAAY;SACZ,EACC,EAAA,QAAQ,CACgB,EACzB;AACH;;;;"}
|
package/package.json
CHANGED
|
@@ -37,8 +37,11 @@ const SearchContainer = ({
|
|
|
37
37
|
setQuery("");
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
+
// Update input value when query changes from context (e.g., loaded from URL or localStorage)
|
|
40
41
|
useEffect(() => {
|
|
41
|
-
if (query
|
|
42
|
+
if (query !== null && query !== inputValue) {
|
|
43
|
+
setInputValue(query);
|
|
44
|
+
} else if (query === null || query === "") {
|
|
42
45
|
setInputValue("");
|
|
43
46
|
}
|
|
44
47
|
}, [query]);
|
|
@@ -214,15 +214,23 @@ export const MapListProvider: React.FC<MapListProviderProps> = ({
|
|
|
214
214
|
// Check URL first
|
|
215
215
|
const urlData = filtersFromURL(window.location);
|
|
216
216
|
|
|
217
|
-
// If ls-ignore=true is in URL, don't
|
|
217
|
+
// If ls-ignore=true is in URL, ONLY use URL query (don't fall back to localStorage)
|
|
218
218
|
if (urlData?.lsIgnore) {
|
|
219
219
|
return urlData?.query || null;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
+
// If setFiltersUrl is enabled and there's a query in URL, use it
|
|
222
223
|
if (setFiltersUrl === true && urlData?.query) {
|
|
223
224
|
return urlData.query;
|
|
224
225
|
}
|
|
225
|
-
|
|
226
|
+
|
|
227
|
+
// Only fall back to localStorage if there's NO query param in URL
|
|
228
|
+
// This prevents localStorage from overriding empty query params
|
|
229
|
+
if (setFiltersUrl === true && typeof urlData?.query !== 'undefined') {
|
|
230
|
+
return null; // URL has query param but it's empty/null
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Fall back to localStorage only if URL has no query param at all
|
|
226
234
|
return getQuery(localStorageKey);
|
|
227
235
|
}
|
|
228
236
|
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import api from '~/apis/hcApi';
|
|
2
|
-
import { MapConfig } from '~/types/config/MapConfig';
|
|
3
|
-
|
|
4
|
-
export const getMapConfig = async (): Promise<MapConfig> => {
|
|
5
|
-
try {
|
|
6
|
-
const response = await api.get<MapConfig>(`/MapConfig`);
|
|
7
|
-
return response;
|
|
8
|
-
} catch (error) {
|
|
9
|
-
console.error("Error retrieving map configuration:", error);
|
|
10
|
-
throw error;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export default {
|
|
15
|
-
getMapConfig
|
|
16
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { getListings } from '~/services/listingService';
|
|
2
|
-
import { getListingEntities } from '~/services/listingEntityService';
|
|
3
|
-
import { getDistinctItemsByProximity } from '~/util/mapUtil';
|
|
4
|
-
import { Listing } from '~/types/Listings';
|
|
5
|
-
import { ListingEntity } from '~/types/ListingEntity';
|
|
6
|
-
|
|
7
|
-
interface FetchListingsResult {
|
|
8
|
-
listingsResult: Listing[];
|
|
9
|
-
entitiesByKey: Record<string, ListingEntity>;
|
|
10
|
-
|
|
11
|
-
distinctItems: any; // Update this type based on the return type of getDistinctItemsByProximity
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const fetchListings = async (
|
|
15
|
-
commuteLocation: any | null = null,
|
|
16
|
-
entities: ListingEntity[] | null,
|
|
17
|
-
listings: Listing[] | null,
|
|
18
|
-
getListingEntitiesCallback?: (origin?: string) => Promise<ListingEntity[]>,
|
|
19
|
-
noEntities: boolean = false
|
|
20
|
-
): Promise<FetchListingsResult> => {
|
|
21
|
-
try {
|
|
22
|
-
const listingsResult = listings && listings.length > 0 ? listings : await getListings();
|
|
23
|
-
|
|
24
|
-
// Only fetch entities if noEntities is false
|
|
25
|
-
const fetchedEntities = noEntities ? {} : (
|
|
26
|
-
!commuteLocation
|
|
27
|
-
? entities && entities.length > 0 ? entities : !getListingEntitiesCallback ? await getListingEntities() : await getListingEntitiesCallback()
|
|
28
|
-
: !getListingEntitiesCallback ? await getListingEntities(
|
|
29
|
-
`${commuteLocation.lat}, ${commuteLocation.lng}`
|
|
30
|
-
) : await getListingEntitiesCallback(
|
|
31
|
-
`${commuteLocation.lat}, ${commuteLocation.lng}`)
|
|
32
|
-
);
|
|
33
|
-
const entitiesByKey = fetchedEntities;
|
|
34
|
-
// Update travel time only if entities were fetched
|
|
35
|
-
if (!noEntities && entitiesByKey) {
|
|
36
|
-
for (let i = 0; i < listingsResult.length; i++) {
|
|
37
|
-
const listing = listingsResult[i];
|
|
38
|
-
if (listing.fields && listing.fields.entityKey && listing.fields.entityKey !== '' && listing.fields) {
|
|
39
|
-
// Try exact match first, then lowercase match for case-insensitive lookup
|
|
40
|
-
const entity = entitiesByKey[listing.fields.entityKey] || entitiesByKey[listing.fields.entityKey.toLowerCase()];
|
|
41
|
-
console.log("Entity for listing with travel time", listing.fields.entityKey, entity);
|
|
42
|
-
|
|
43
|
-
if (entity) {
|
|
44
|
-
listing.fields.travelTime = entity.travelTime;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const distinctItems = getDistinctItemsByProximity(
|
|
51
|
-
listingsResult,
|
|
52
|
-
entitiesByKey || {}
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
return {
|
|
56
|
-
listingsResult,
|
|
57
|
-
entitiesByKey,
|
|
58
|
-
distinctItems
|
|
59
|
-
};
|
|
60
|
-
} catch (error) {
|
|
61
|
-
console.error("Error fetching listings:", error);
|
|
62
|
-
throw error;
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export default fetchListings;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import api from '~/apis/hcApi';
|
|
2
|
-
|
|
3
|
-
export const getListingEntities = async (origin = ''): Promise<any> => {
|
|
4
|
-
try {
|
|
5
|
-
//need to update / or add better endpoint fo this to match original functioanlity
|
|
6
|
-
const response = await api.get<any>(`/listingentities/MapEntities?origin=${origin}`);
|
|
7
|
-
return response;
|
|
8
|
-
} catch (error) {
|
|
9
|
-
console.error("Error fetching listing entities:", error);
|
|
10
|
-
throw error;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export default {
|
|
15
|
-
getListingEntities
|
|
16
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// listingService.ts
|
|
2
|
-
import { GetListingsParams } from '~/types/GetListingParams';
|
|
3
|
-
import api from '../apis/hcApi';
|
|
4
|
-
import { Listing } from '../types/Listings';
|
|
5
|
-
|
|
6
|
-
export const getListings = async (params?: GetListingsParams): Promise<Listing[]> => {
|
|
7
|
-
try {
|
|
8
|
-
const response = await api.get(`/joblistings/maplistings`);
|
|
9
|
-
|
|
10
|
-
return response as Listing[];
|
|
11
|
-
} catch (error) {
|
|
12
|
-
console.error(error);
|
|
13
|
-
throw error;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const getListingDetails = async (listingId: string) => {
|
|
18
|
-
try {
|
|
19
|
-
const response = await api.get(`/ListingDetails/${listingId}`);
|
|
20
|
-
return response;
|
|
21
|
-
} catch (error) {
|
|
22
|
-
console.error(error);
|
|
23
|
-
throw error;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export default {
|
|
28
|
-
getListings,
|
|
29
|
-
getListingDetails
|
|
30
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import api from '~/apis/hcApi';
|
|
2
|
-
import { Recruiter } from '~/types/Recruiter';
|
|
3
|
-
|
|
4
|
-
export const getRecruiters = async (recruiterIds: number[]): Promise<Recruiter[]> => {
|
|
5
|
-
try {
|
|
6
|
-
const params = recruiterIds.map(id => `recruiterIds=${id}`).join("&");
|
|
7
|
-
|
|
8
|
-
const response = await api.get<Recruiter[]>(`/Recruiters?${params}`);
|
|
9
|
-
return response;
|
|
10
|
-
} catch (error) {
|
|
11
|
-
console.error("Error fetching recruiters:", error);
|
|
12
|
-
throw error;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
getRecruiters
|
|
18
|
-
};
|