Spaces:
Runtime error
Runtime error
automated-invoice-processing-agent-backend
/
src
/controllers
/propertyware
/buildings.controller.ts
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); | |
} | |
}; | |