File size: 648 Bytes
1f6a8f9
 
 
 
2c97468
9c63b5a
1f6a8f9
 
185ec1f
 
 
 
d747060
 
185ec1f
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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);
    }
};