server/src/controllers/userBooks.js
File userBooks.js
has 346 lines of code (exceeds 250 allowed). Consider refactoring. Invalid
Invalid
import { toDate } from 'validator';
import models from '../models';
import pagination from '../controllers/helpers/pagination';
const {
Function loanBook
has 130 lines of code (exceeds 60 allowed). Consider refactoring. Open
Open
loanBook(req, res) {
const userId = req.user.id.id || req.user.id;
const { bookId } = req.body;
if (!req.body.returnDate) {
return res
Function returnBook
has 86 lines of code (exceeds 60 allowed). Consider refactoring. Open
Open
returnBook(req, res) {
const userId = req.user.id.id || req.user.id;
const bookId = req.body.bookId;
UserBooks.findOne({
where: {