feat: update getClientAccessToken to use query parameters and validate inputs
parent
26704767ba
commit
5f6c8be1c9
|
@ -595,10 +595,13 @@ const webhook_crm = async (req, res) => {
|
|||
|
||||
const getClientAccessToken = async (req, res) => {
|
||||
const { companyId } = req.params
|
||||
const { clientId } = req.body;
|
||||
const { clientId } = req.query
|
||||
console.log('========> getClientAccessToken companyId: ', companyId, ' clientId: ', clientId);
|
||||
|
||||
mustContainProperties(req, ['clientId']);
|
||||
if (!companyId || !clientId) {
|
||||
console.error('Company ID or Client ID is missing in the request parameters.');
|
||||
return res.status(StatusCodes.BAD_REQUEST).send({ msg: "Company ID and Client ID are required!" });
|
||||
}
|
||||
|
||||
const accessToken = await getAccessToken(clientId, companyId);
|
||||
|
||||
|
|
Loading…
Reference in New Issue