Either all code paths should have explicit returns, or none of them JS-0045
Anti-pattern
Minor
8 months ago3 years old
Expected to return a value at the end of async arrow function
 91  "dis_loop_boyutu",
 92];
 93
 94const upload = async (req, res) => { 95  try {
 96    if (req.file == undefined) {
 97      return res.status(400).json({
Expected to return a value at the end of async arrow function
108    res.status(200).send({ message: "Password reset email sent" });
109  });
110};
111exports.resetPassword = async (req, res) => {112  // Get the token and new password from the request body
113  const { email, password, securitycode } = req.body;
114
Expected to return a value at the end of arrow function
 97    text: `Güvenlik Kodu (5 dakika için geçerli) : ${token}`,
 98  };
 99
100  transporter.sendMail(mailOptions, (error, info) => {101    if (error) {
102      console.log(error);
103      return res
Expected to return a value at the end of async arrow function
 54};
 55
 56// Function to handle forgot password request
 57exports.forgotPassword = async (req, res) => { 58  // Get the email from the request body
 59  const { email } = req.body;
 60
Expected to return a value at the end of arrow function
 2const fs = require("fs");
 3const path = require("path");
 4
 5const excelFilter = (req, file, cb) => { 6  if (
 7    fs.existsSync(path.join(__basedir + "/app/uploads/", file.originalname))
 8  ) {