refactor: Use global output with slack actions

This commit is contained in:
Faruk AYDIN
2022-10-21 19:21:14 +02:00
parent 00be50d2fd
commit 585adb14e6
2 changed files with 7 additions and 17 deletions

View File

@@ -21,14 +21,11 @@ const findMessage = async ($: IGlobalVariable, options: FindMessageOptions) => {
const data = response.data;
const message: IActionOutput = {
data: {
raw: data?.messages.matches[0],
},
error: response?.httpError || (!data.ok && data),
};
if (!data.ok && data) {
throw new Error(JSON.stringify(response.data));
}
return message;
$.actionOutput.data.raw = data?.messages.matches[0];
};
export default findMessage;