This commit is contained in:
atorop
2024-10-22 16:20:56 +03:00
parent 9b9e2d0355
commit 7aae218182
3 changed files with 176 additions and 152 deletions

View File

@@ -26,7 +26,7 @@ exports.createTicket = async (title, description) => {
});
return response.data.id;
}catch(e){
fs.appendFileSync(__dirname + "/../logs/logs.json", JSON.stringify(e, null, 3));
fs.appendFileSync(__dirname + "/../logs/logs.json", JSON.stringify("*** createTicket:\n" + e, null, 3));
}
}
@@ -51,7 +51,7 @@ exports.changeStatusTicket = async (ticketId, statusId) => {
});
return response;
}catch(e){
fs.appendFileSync(__dirname + "/../logs/logs.json", JSON.stringify(e, null, 3));
fs.appendFileSync(__dirname + "/../logs/logs.json", JSON.stringify("*** changeStatusTicket:\n" + e, null, 3));
}
}
@@ -77,7 +77,7 @@ exports.assignTicket = async (ticketId, userId) => {
});
return response.data;
}catch(e){
fs.appendFileSync(__dirname + "/../logs/logs.json", JSON.stringify(e, null, 3));
fs.appendFileSync(__dirname + "/../logs/logs.json", JSON.stringify("*** assignTicket:\n" + e, null, 3));
}
}
@@ -96,7 +96,7 @@ exports.getItem = async(item, id) => { // ITILFollowup = комментари
});
return response.data;
}catch(e){
fs.appendFileSync(__dirname + "/../logs/logs.json", JSON.stringify(e, null, 3));
fs.appendFileSync(__dirname + "/../logs/logs.json", JSON.stringify("*** getItem:\n" + e, null, 3));
}
}
@@ -115,7 +115,7 @@ exports.getAllItems = async(item, cnt) => {
});
return response.data;
}catch(e){
fs.appendFileSync(__dirname + "/../logs/logs.json", JSON.stringify(e, null, 3));
fs.appendFileSync(__dirname + "/../logs/logs.json", JSON.stringify("*** getAllItems:\n" + e, null, 3));
}
}
@@ -141,7 +141,7 @@ exports.addComment = async(ticketId, comment) => {
});
return response.data;
}catch(e){
fs.appendFileSync(__dirname + "/../logs/logs.json", JSON.stringify(e, null, 3));
fs.appendFileSync(__dirname + "/../logs/logs.json", JSON.stringify("*** addComment:\n" + e, null, 3));
}
}
@@ -166,7 +166,7 @@ exports.removeComment = async(ticketId, commentId) => {
});
return response.data;
}catch(e){
fs.appendFileSync(__dirname + "/../logs/logs.json", JSON.stringify(e, null, 3));
fs.appendFileSync(__dirname + "/../logs/logs.json", JSON.stringify("*** removeComment:\n" + e, null, 3));
}
}
@@ -185,6 +185,6 @@ exports.getUsers = async(ticketId) => {
});
return response.data;
}catch(e){
fs.appendFileSync(__dirname + "/../logs/logs.json", JSON.stringify(e, null, 3));
fs.appendFileSync(__dirname + "/../logs/logs.json", JSON.stringify("*** getUsers:\n" + e, null, 3));
}
}