(completed, blockers, planned, userName, taskId, taskTitle)
| 2 | const DISCORD_BASE_URL = config.get("services.discordBot.baseUrl"); |
| 3 | |
| 4 | export const sendTaskUpdate = async (completed, blockers, planned, userName, taskId, taskTitle) => { |
| 5 | try { |
| 6 | const headers = generateCloudFlareHeaders(); |
| 7 | const body = { |
| 8 | content: { |
| 9 | completed, |
| 10 | blockers, |
| 11 | planned, |
| 12 | userName, |
| 13 | taskId, |
| 14 | taskTitle, |
| 15 | }, |
| 16 | }; |
| 17 | await fetch(`${DISCORD_BASE_URL}/task/update`, { |
| 18 | method: "POST", |
| 19 | headers, |
| 20 | body: JSON.stringify(body), |
| 21 | }); |
| 22 | } catch (error) { |
| 23 | logger.error("Something went wrong", error); |
| 24 | throw error; |
| 25 | } |
| 26 | }; |
no test coverage detected