summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-02-01 04:07:30 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-02-01 04:07:30 +0900
commit9e97ca4caac55bd88829211faf64662b7bee0d1e (patch)
treeb28c29ad36a2c0bbede06387dee370b8802a4e28 /src
parentRefactor: Improve readability (diff)
downloadsharkey-9e97ca4caac55bd88829211faf64662b7bee0d1e.tar.gz
sharkey-9e97ca4caac55bd88829211faf64662b7bee0d1e.tar.bz2
sharkey-9e97ca4caac55bd88829211faf64662b7bee0d1e.zip
Refactor: Improve readabiliy
Diffstat (limited to 'src')
-rw-r--r--src/api/service/github.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/api/service/github.ts b/src/api/service/github.ts
index b9804c292e..c23a229a18 100644
--- a/src/api/service/github.ts
+++ b/src/api/service/github.ts
@@ -29,15 +29,15 @@ module.exports = async (app: express.Application) => {
});
handler.on('issues', event => {
- const info = event.payload;
+ const issue = event.payload.issue;
+ const action = event.payload.action;
let title: string;
- switch (info.action) {
+ switch (action) {
case 'opened': title = 'Issueが立ちました'; break;
case 'closed': title = 'Issueが閉じられました'; break;
case 'reopened': title = 'Issueが開きました'; break;
default: return;
}
- const text = `${title}: ${info.issue.number}「${info.issue.title}」\n${info.issue.html_url}`;
- post(text);
+ post(`${title}: ${issue.number}「${issue.title}」\n${issue.html_url}`);
});
};