node-go/server/controllers/api/apiRoom.js

17 lines
368 B
JavaScript
Raw Normal View History

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