spee.ch/server/controllers/api/channel/availability/checkChannelAvailability.js
2018-05-03 15:47:58 -07:00

18 lines
341 B
JavaScript

const db = require('../../../../models');
const checkChannelAvailability = (name) => {
return db.Channel
.findAll({
where: {
channelName: name,
},
})
.then(result => {
return (result.length <= 0);
})
.catch(error => {
throw error;
});
};
module.exports = checkChannelAvailability;