|
|
|
@ -739,7 +739,7 @@ exports.addDepartment = async (request, reply) => {
|
|
|
|
|
|
|
|
|
|
const getLocationsByCityAndZone = async (city, zone) => {
|
|
|
|
|
try {
|
|
|
|
|
const result = await City.aggregate([
|
|
|
|
|
const result = await Branch.aggregate([
|
|
|
|
|
{
|
|
|
|
|
$project: {
|
|
|
|
|
city: { $toLower: { $trim: { input: "$city" } } }, // Normalize city name (lowercase & trim)
|
|
|
|
@ -876,7 +876,7 @@ exports.getZonebasedLocations = async (req, reply) => {
|
|
|
|
|
|
|
|
|
|
const getZonesByCitys = async (city) => {
|
|
|
|
|
try {
|
|
|
|
|
const result = await City.aggregate([
|
|
|
|
|
const result = await Branch.aggregate([
|
|
|
|
|
{
|
|
|
|
|
$project: {
|
|
|
|
|
city: { $trim: { input: "$city" } }, // Trim city field in DB
|
|
|
|
|