import db from "./db.js"; /** @typedef User * @property {number} id - The unique identifier for the user. * @property {string} username - The username of the user. * @property {string} password - The hashed password of the user. */ /** * Fetches all users from the database. * @return {Promise} */ const getAllUsers = async () => { try { return await db.query('SELECT * FROM users').then((users) => users); } catch (error) { console.error('Error fetching users:', error); throw error; } } export default { getAllUsers }