narinder1231's picture
improve error logging and error messages
d747060
raw
history blame contribute delete
648 Bytes
import { Request, Response } from 'express';
import { fetchBuildings } from '../../shared/services/propertyware.service';
import PwBuildings from '../../models/pwBuildings';
import { logger } from '../../utils/logger';
import { syncBuildingsDataService } from '../../shared/services/buildings.service';
export const syncBuildingsData = async (req: Request, res: Response) => {
try {
const result = await syncBuildingsDataService();
res.status(200).send(result);
} catch (error) {
logger.error('Error syncing Buildings');
logger.error(error);
res.status(500).send((error as Error).message);
}
};