Skip to content

Develop a mein#3

Merged
PabloPianelo merged 31 commits intomainfrom
develop
May 11, 2025
Merged

Develop a mein#3
PabloPianelo merged 31 commits intomainfrom
develop

Conversation

@PabloPianelo
Copy link
Contributor

No description provided.

PabloPianelo and others added 30 commits April 22, 2025 09:56
implement synopsis ,author,imgBook
implement  synopsis,author,imgBook
array author and genre
@@ -0,0 +1,55 @@
const Book = require('../models/BookModel');


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elimina las líneas en blanco innecesarias al principio del archivo. Una sola línea de separación es suficiente.

* GET /books
*/

const getBook = async (req, res) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

El nombre de la función getBook debería ser getBooks ya que devuelve múltiples libros, no uno solo.


const getBook = async (req, res) => {
try {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elimina esta línea en blanco innecesaria dentro de la función.

try {


const books = await Book.find(); // Obtén todos los libros

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considera añadir opciones de paginación para optimizar el rendimiento cuando la colección crezca. Por ejemplo: const books = await Book.find().limit(limit).skip(skip);

}
};


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elimina las líneas en blanco innecesarias entre funciones. Una sola línea de separación es suficiente.

.matches(/[!@#$%^&*(),.?":{}|<>]/)
.withMessage('La contraseña debe contener al menos un carácter especial'),validationChecker
]
,loginUser )

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mejora el formato de la ruta. Coloca loginUser en la misma línea que el cierre del array de validaciones o en una nueva línea con indentación adecuada.

.withMessage('La contraseña debe contener al menos un carácter especial'),validationChecker
]
,loginUser )
//solo puede estrar si esta logueado

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mejora el comentario para que sea más descriptivo. "solo puede estrar si esta logueado" contiene un error tipográfico y podría ser más formal, como: "// Middleware de autenticación - Las rutas siguientes requieren usuario autenticado".

//solo puede estrar si esta logueado
router.use(getAuthUser);

//prueba

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elimina el comentario y código comentado. Si la ruta /me no está implementada, es mejor quitar estas líneas hasta que se necesiten.

//prueba
// router.get('/me',getUser);


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elimina la línea en blanco excesiva antes de module.exports.

// router.get('/me',getUser);


module.exports = router; No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Añade una nueva línea al final del archivo para seguir las convenciones estándar de archivos de texto.

@PabloPianelo PabloPianelo merged commit fca675f into main May 11, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants