unit tests fixin
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 41s
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 41s
This commit is contained in:
@@ -2,7 +2,7 @@ import { Router, Request, Response, NextFunction } from 'express';
|
||||
import multer from 'multer';
|
||||
import passport from './passport';
|
||||
import { optionalAuth } from './passport';
|
||||
import * as aiService from '../services/aiService.server';
|
||||
import * as aiService from '../services/aiService.server'; // Correctly import server-side AI service
|
||||
import { logger } from '../services/logger';
|
||||
import { UserProfile } from '../types';
|
||||
|
||||
@@ -121,9 +121,12 @@ router.post('/search-web', passport.authenticate('jwt', { session: false }), asy
|
||||
|
||||
router.post('/plan-trip', passport.authenticate('jwt', { session: false }), async (req, res, next) => {
|
||||
try {
|
||||
logger.info(`Server-side trip planning requested.`);
|
||||
res.status(200).json({ text: "Here is your trip plan.", sources: [] }); // Stubbed response
|
||||
const { items, store, userLocation } = req.body;
|
||||
logger.info(`Server-side trip planning requested for user.`);
|
||||
const result = await aiService.planTripWithMaps(items, store, userLocation);
|
||||
res.status(200).json(result);
|
||||
} catch (error) {
|
||||
logger.error('Error in /api/ai/plan-trip endpoint:', { error });
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user