Location.getLocationByUrlSlugWithPromise = function(urlSlug) {
return new Promise((resolve, reject) => {
Location.getLocationByUrlSlug(urlSlug, (error, location) => {
if (error) {
return reject(error);
}
if (location) {
return resolve(location);
}
return relose(null);
});
})
}