C:\Users\Ilya\Downloads\my-musician-network\node_modules\mysql\lib\protocol\Parser.js:437
      throw err; // Rethrow non-MySQL errors
      ^

TypeError: callback is not a function
    at Query.<anonymous> (C:\Users\Ilya\Downloads\my-musician-network\app.js:70:14)

// Функция для получения последних музыкантов, зарегистрированных музыкантов
function getLastNRegisteredMusicians(N, callback) {
connection.query("SELECT * FROM users ORDER BY id DESC LIMIT ?", [N], (err, result) => {
if (err) {
console.error("Ошибка при получении последних зарегистрированных музыкантов: ", err);
return callback(err);
} else {
return callback(null, result);
}
});
}

function getMusicians(callback) {
  connection.query("SELECT * FROM users", (err, result) => {
    if (err) {
      console.error("Ошибка при получении списка музыкантов: ", err);
      return callback(err);
    } else {
      return callback(null, result);
    }
  });
}

// Функция для получения музыканта по id
function getMusicianById(id, callback) {
  connection.query("SELECT * FROM users WHERE id=?", [id], (err, result) => {
    if (err) {
      console.error("Ошибка при получении музыканта с id ${id}: ", err);
      return callback(err);
    } else {
      return callback(null, result[0]);
    }
  });
}

function requireLogin(req, res, next) {
  if (req.session.musicianId) {
    next();
  } else {
    res.redirect("/login");
  }
}

//search function
function search(term, role, city, genre, callback) {
  const queryValues = [
    `%${term.toLowerCase()}%`,
    role === '' ? null : role,
    city === '' ? null : city.toLowerCase().trim(),
    genre === '' ? null : genre.toLowerCase()
  ];

  const queryConditions = [
    'name LIKE ? OR genre LIKE ?',
    'role = ?',
    'city = ?',
    'genre = ?'
  ].filter(condition => queryValues[queryConditions.indexOf(condition)] !== null);

  const sql = `SELECT * FROM users WHERE ${queryConditions.join(' AND ')}`;

  connection.query(sql, queryValues, (err, result) => {
    if (err) {
      console.error('Ошибка при поиске: ', err);
      callback(err, []);
    } else {
      const results = result.map(musician => {
        return {
          name: musician.name,
          genre: musician.genre,
          originalName: musician.name,
          profileLink: `/profile/${musician.id}`,
          thumbnail: musician.thumbnail,
          soundcloud: musician.soundcloud,
          role: musician.role,
          city: musician.city
        };
}).sort((a, b) => {
          const aNameScore = a.name.toLowerCase().startsWith(query) ? 2 : a.name.toLowerCase().includes(query) ? 1 : 0;
          const bNameScore = b.name.toLowerCase().startsWith(query) ? 2 : b.name.toLowerCase().includes(query) ? 1 : 0;
          const aGenreScore = a.genre.toLowerCase().startsWith(query) ? 2 : a.genre.toLowerCase().includes(query) ? 1 : 0;
          const bGenreScore = b.genre.toLowerCase().startsWith(query) ? 2 : b.genre.toLowerCase().includes(query) ? 1 : 0;

          // Sort by name score, then genre score, then location score (descending)
          if (aNameScore + aGenreScore + a.city < bNameScore + bGenreScore + b.city) {
            return 1;
          } else if (aNameScore + aGenreScore + a.city > bNameScore + bGenreScore + b.city) {
            return -1;
          } else {
            return 0;
          }
        });

        // Remove duplicates
        results = results.filter((result, index, self) =>
          index === self.findIndex(r => (
            r.name === result.name && r.genre === result.genre && r.city === result.city
          ))
        );

        callback(null, results);
    }
  });
}

fix this shit