async function groupOwnedBy(pool, userId, groupId) { const { rows } = await pool.query( 'SELECT 1 FROM groups WHERE id = $1 AND tutor_id = $2', [groupId, userId] ); return rows.length > 0; } module.exports = { groupOwnedBy };