master^2
Bhaskar 8 months ago
parent 7145831d8f
commit e3fffb8ab9

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

Loading…
Cancel
Save