FEAT: Função que fecha um ticket no Hubsoft.
This commit is contained in:
parent
a1be9223a5
commit
8e47f46459
@ -55,6 +55,30 @@ const updateAtendimentoStatus = async (id_atendimento, newStatus) => {
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
updateAtendimentoStatus
|
||||
const closeAtendimento = async (id_atendimento, closingMessage) => {
|
||||
try {
|
||||
const token = await getAuthToken();
|
||||
|
||||
const response = await axios.put(`${apiConfig.hubsoft.atendimentosUrl}${id_atendimento}`, {
|
||||
"fechar_atendimento": true,
|
||||
"parametros_fechamento": {
|
||||
"descricao_fechamento": closingMessage
|
||||
}
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
'Authorization': `Bearer ${token}`,
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
logError(`Erro ao fechar atendimento ID ${id_atendimento}:`, error.response ? error.response.data : error.message);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
updateAtendimentoStatus,
|
||||
closeAtendimento
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user