Both the web app and the mobile app feature a dropdown/selector to choose between "Message" and "Email", and both frontends send this data in their POST request payloads ({ text: text, type: type }).
However, the Node.js backend (backend/server.js) strips this data out before forwarding the request to the Flask ML API:
const { text } = req.body;
// ...
const response = await axios.post(process.env.API, {
text: text, // 'type' is not forwarded
});
While api.py doesn't currently utilize the type field, dropping it at the Node.js layer limits future extensibility. If the machine learning architecture is ever updated to route messages through different models or preprocessing steps depending on whether the input is an email or an SMS, this missing parameter will become a bottleneck.
Suggested Fix:
Modify server.js to forward the entire payload or explicitly extract and forward type:
const { text, type } = req.body;
// ...
const response = await axios.post(process.env.API, { text, type });
Both the web app and the mobile app feature a dropdown/selector to choose between "Message" and "Email", and both frontends send this data in their POST request payloads (
{ text: text, type: type }).However, the Node.js backend (
backend/server.js) strips this data out before forwarding the request to the Flask ML API:While
api.pydoesn't currently utilize thetypefield, dropping it at the Node.js layer limits future extensibility. If the machine learning architecture is ever updated to route messages through different models or preprocessing steps depending on whether the input is an email or an SMS, this missing parameter will become a bottleneck.Suggested Fix:
Modify
server.jsto forward the entire payload or explicitly extract and forwardtype: