diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-02-01 04:04:18 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-02-01 04:04:18 +0900 |
| commit | 3a39b2aac2f1b399ee9cbb045c1c085fddf658f9 (patch) | |
| tree | bebc366139015cc464eba67d49ad8a8382a4a3b5 /src/api | |
| parent | :art: (diff) | |
| download | sharkey-3a39b2aac2f1b399ee9cbb045c1c085fddf658f9.tar.gz sharkey-3a39b2aac2f1b399ee9cbb045c1c085fddf658f9.tar.bz2 sharkey-3a39b2aac2f1b399ee9cbb045c1c085fddf658f9.zip | |
Refactor: Improve readability
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/service/github.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/api/service/github.ts b/src/api/service/github.ts index e1a465894a..b9804c292e 100644 --- a/src/api/service/github.ts +++ b/src/api/service/github.ts @@ -29,14 +29,15 @@ module.exports = async (app: express.Application) => { }); handler.on('issues', event => { + const info = event.payload; let title: string; - switch (event.payload.action) { + switch (info.action) { case 'opened': title = 'Issueが立ちました'; break; case 'closed': title = 'Issueが閉じられました'; break; case 'reopened': title = 'Issueが開きました'; break; default: return; } - const text = `${title}: ${event.payload.issue.number}「${event.payload.issue.title}」\n${event.payload.issue.html_url}`; + const text = `${title}: ${info.issue.number}「${info.issue.title}」\n${info.issue.html_url}`; post(text); }); }; |