feature/IO-3556-Chattr-Integration
This commit is contained in:
22
server/chatter/createLocation.js
Normal file
22
server/chatter/createLocation.js
Normal file
@@ -0,0 +1,22 @@
|
||||
const DEFAULT_COMPANY_ID = process.env.CHATTER_DEFAULT_COMPANY_ID;
|
||||
|
||||
const createLocation = (req, res) => {
|
||||
const { logger } = req;
|
||||
const { bodyshopID } = req.body;
|
||||
|
||||
// No Default company
|
||||
if (!DEFAULT_COMPANY_ID) {
|
||||
logger.log("chatter-create-location-no-default-company", "warn", null, null, { bodyshopID });
|
||||
return res.json({ success: false });
|
||||
}
|
||||
|
||||
// No Bodyshop data available
|
||||
if (!bodyshopID) {
|
||||
logger.log("chatter-create-location-invalid-bodyshop", "warn", null, null, { bodyshopID });
|
||||
return res.json({ success: false });
|
||||
}
|
||||
|
||||
return res.json({ success: true });
|
||||
};
|
||||
|
||||
module.exports = createLocation;
|
||||
Reference in New Issue
Block a user