Skip to content

Commit

Permalink
Reorganizacion de carpetas y instalacion de front basico
Browse files Browse the repository at this point in the history
  • Loading branch information
rubromgui committed Mar 29, 2024
1 parent b81fdd8 commit 5f34e3f
Show file tree
Hide file tree
Showing 16 changed files with 187 additions and 402 deletions.
3 changes: 2 additions & 1 deletion .gcloudignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
.gitignore

# Node.js dependencies:
node_modules/
node_modules/
front/node_modules/
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
const { json } = require("body-parser");

const API_BASE = '/api/v1/mentalhealth-datasets';




// Datos de ejemplo
module.exports = (app, dbMental) => {
function loadMentalApi(app, dbMental) {


// Ruta para redirigir al portal de documentación de Postman
Expand Down Expand Up @@ -192,7 +187,7 @@ module.exports = (app, dbMental) => {
}
if (datosMental) {
delete datosMental._id;

res.status(200).json(datosMental); // Devuelve un solo objeto
} else {
res.status(404).json({ message: 'Data not found for the specified country and year,404' });
Expand Down Expand Up @@ -266,14 +261,14 @@ module.exports = (app, dbMental) => {
if (newData.country && newData.country !== countryName) {
res.status(400).json({ error: 'Mismatched ID in the request body,400' });
return;

}

dbMental.update({ country: countryName }, { $set: newData }, { multi: true }, (err, numUpdated) => {
if (err) {
res.status(500).json({ error: 'Internal Server Error' });
return;

}
if (numUpdated > 0) {
res.status(200).json({ message: 'Updated,200' });
Expand Down Expand Up @@ -373,11 +368,6 @@ module.exports = (app, dbMental) => {
}
});
});
};






}

export { loadMentalApi };
Loading

0 comments on commit 5f34e3f

Please sign in to comment.