narinder1231's picture
improve error logging and error messages
d747060
raw
history blame contribute delete
651 Bytes
import { Request, Response } from 'express';
import { fetchPortfolio } from '../../shared/services/propertyware.service';
import PwPortfolio from './../../models/pwPortfolio';
import { logger } from '../../utils/logger';
import { syncPortfolioDataService } from '../../shared/services/portfolio.service';
export const syncPortfolioData = async (req: Request, res: Response) => {
try {
const result = await syncPortfolioDataService();
res.status(200).send(result);
} catch (error) {
logger.error('Error syncing Portfolio');
logger.error(error);
res.status(500).send((error as Error).message);
}
};