Skip to content

Commit fc59da5

Browse files
committed
simplify createJob calls
1 parent f6abec3 commit fc59da5

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/pull/labeled.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ module.exports = (queue) => async (context) => {
4848

4949
return (
5050
queue
51-
.createJob({
52-
...context.pullRequest({ installation_id: context.payload.installation.id }),
53-
action: MERGE,
54-
method,
55-
})
51+
.createJob(
52+
context.pullRequest({
53+
installation_id: context.payload.installation.id,
54+
action: MERGE,
55+
method,
56+
})
57+
)
5658
.setId(ID)
5759
// https://github.com/reporanger/feedback/issues/1
5860
.delayUntil(Date.now() + PULL_REQUEST_MERGE_DELAY)

src/thread/closed.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ module.exports = (queue) => async (context) => {
1717
return executeAction(action, {
1818
[LOCK]: () => {
1919
return queue
20-
.createJob({
21-
...context.issue({ installation_id: context.payload.installation.id }),
22-
action: LOCK,
23-
})
20+
.createJob(
21+
context.issue({ installation_id: context.payload.installation.id, action: LOCK })
22+
)
2423
.setId(getId(context, { action: LOCK }))
2524
.delayUntil(Date.now() + ms(delay))
2625
.save()

0 commit comments

Comments
 (0)