@@ -5,8 +5,8 @@ import { MapContainer, Marker, Popup, TileLayer, useMapEvents } from 'react-leaf
5
5
import L , { LatLngExpression , LatLngBounds , LatLngTuple } from 'leaflet' ;
6
6
import _ from 'lodash' ;
7
7
8
+ import { ISeller , ISellerWithSettings } from '@/constants/types' ;
8
9
import { fetchSellers } from '@/services/sellerApi' ;
9
- import { ISeller } from '@/constants/types' ;
10
10
import { toLatLngLiteral } from '@/util/map' ;
11
11
12
12
import MapMarkerPopup from './MapMarkerPopup'
@@ -22,7 +22,7 @@ const sanitizeCoordinates = (lat: number, lng: number) => {
22
22
} ;
23
23
24
24
// Function to fetch seller coordinates based on origin, radius, and optional search query
25
- const fetchSellerCoordinates = async ( origin : LatLngTuple , radius : number , searchQuery ?: string ) : Promise < ISeller [ ] > => {
25
+ const fetchSellerCoordinates = async ( origin : LatLngTuple , radius : number , searchQuery ?: string ) : Promise < ISellerWithSettings [ ] > => {
26
26
const { lat, lng } = sanitizeCoordinates ( origin [ 0 ] , origin [ 1 ] ) ;
27
27
const formattedOrigin = toLatLngLiteral ( [ lat , lng ] ) ;
28
28
@@ -37,7 +37,7 @@ const fetchSellerCoordinates = async (origin: LatLngTuple, radius: number, searc
37
37
} ) ;
38
38
39
39
logger . info ( 'Fetched sellers data:' , { sellersWithCoordinates } ) ;
40
-
40
+
41
41
return sellersWithCoordinates ;
42
42
} catch ( error ) {
43
43
logger . error ( 'Error fetching seller coordinates:' , { error } ) ;
@@ -46,8 +46,8 @@ const fetchSellerCoordinates = async (origin: LatLngTuple, radius: number, searc
46
46
} ;
47
47
48
48
// Function to remove duplicate sellers based on seller_id
49
- const removeDuplicates = ( sellers : ISeller [ ] ) : ISeller [ ] => {
50
- const uniqueSellers : { [ key : string ] : ISeller } = { } ;
49
+ const removeDuplicates = ( sellers : ISellerWithSettings [ ] ) : ISellerWithSettings [ ] => {
50
+ const uniqueSellers : { [ key : string ] : ISellerWithSettings } = { } ;
51
51
sellers . forEach ( seller => {
52
52
uniqueSellers [ seller . seller_id ] = seller ;
53
53
} ) ;
@@ -66,7 +66,7 @@ const Map = ({ center, zoom, searchQuery, searchResults }: { center: LatLngExpre
66
66
} ) ;
67
67
68
68
const [ position , setPosition ] = useState < L . LatLng | null > ( null ) ;
69
- const [ sellers , setSellers ] = useState < ISeller [ ] > ( [ ] ) ;
69
+ const [ sellers , setSellers ] = useState < ISellerWithSettings [ ] > ( [ ] ) ;
70
70
const [ origin , setOrigin ] = useState ( center ) ;
71
71
const [ radius , setRadius ] = useState ( 10 ) ;
72
72
const [ loading , setLoading ] = useState ( false ) ;
0 commit comments