Skip to content

Commit

Permalink
fix: remove unneeded arg (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland authored Feb 12, 2024
1 parent 7ae506d commit ffcb4bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/Jobs/SendNotificationWhenFollowerPosted.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ class SendNotificationWhenFollowerPosted implements ShouldQueue

protected $lastPostNumber;

public function __construct(Post $post, int $lastPostNumber)
public function __construct(Post $post)
{
$this->post = $post;
$this->lastPostNumber = $lastPostNumber;
}

public function handle(NotificationSyncer $notifications)
Expand Down
4 changes: 2 additions & 2 deletions src/Listeners/QueueNotificationJobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function whenPostCreated(PostSaving $event)
}

resolve('flarum.queue.connection')->push(
new Jobs\SendNotificationWhenFollowerPosted($post, $post->discussion->last_post_number)
new Jobs\SendNotificationWhenFollowerPosted($post)
);
});
}
Expand All @@ -89,7 +89,7 @@ public function whenPostApproved(PostWasApproved $event)
$this->queue->push(
$event->post->number === 1
? new Jobs\SendNotificationWhenDiscussionIsStarted($event->post->discussion)
: new Jobs\SendNotificationWhenFollowerPosted($event->post, $event->post->number - 1)
: new Jobs\SendNotificationWhenFollowerPosted($event->post)
);
}
}

0 comments on commit ffcb4bb

Please sign in to comment.