13 lines
323 B
JavaScript
13 lines
323 B
JavaScript
const Company = require("../models/Company")
|
|
|
|
async function getIntegrationsConfig(companyId, name) {
|
|
const company = await Company.findOne({ companyId })
|
|
|
|
if (company){
|
|
let obj = company.integrations.find(i => i.name === name)
|
|
return obj?.config
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = getIntegrationsConfig |