Skip to content

Commit

Permalink
Add search by municipalityPart 🎯 (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanb authored Dec 20, 2021
1 parent 79453d2 commit 7032e16
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/services/doctors.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,18 @@ export function createDoctor(doctor, type, institution) {
const provider = trimString(institution.name);
const website = trimString(institution.website);
const phone = trimString(institution.phone);
const { address, city, municipality, post } = institution;
const { address, city, municipalityPart, municipality, post } = institution;
const [_code, _post] = post.split(' ');
const geoLocation = { lat: parseFloat(institution.lat), lon: parseFloat(institution.lon) };

const addressObject = { street: address, postalCode: _code, city, municipality, post: _post };
const addressObject = {
street: address,
postalCode: _code,
city,
municipalityPart,
municipality,
post: _post,
};

const uuid = uuidv4();
const { availability, load } = doctor;
Expand Down Expand Up @@ -65,7 +72,7 @@ export function createDoctor(doctor, type, institution) {
return `${addressObject.street}, ${addressObject.city}`;
},
get searchAddress() {
return `${addressObject.street}, ${addressObject.postalCode} ${addressObject.city} ${addressObject.municipality}`;
return `${addressObject.street}, ${addressObject.postalCode} ${addressObject.city} ${addressObject.municipalityPart} ${addressObject.municipality}`;
},
get geoLocation() {
return geoLocation;
Expand Down

0 comments on commit 7032e16

Please sign in to comment.