node-go/server/controllers/api/apiRoom.js
2020-01-18 15:49:35 -08:00

17 lines
No EOL
368 B
JavaScript

const roomQueries = require('../../data/queries/room');
const roomIndex = async (req, res, next) => {
try {
// TODO eventually add check for user's private rooms
const publicRooms = await roomQueries.findPublicRooms();
res.status(200).json({rooms: publicRooms})
}
catch (err) {
res.status(500).json(err);
}
}
module.exports = {
roomIndex
}