Skip to content

Commit

Permalink
dix get post in post lock functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mh-Asmi committed Sep 19, 2024
1 parent ace4450 commit 2a40f05
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Ushahidi/Modules/V5/Http/Controllers/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,7 @@ public function showPostGeoJson($id, Request $request): PostGeometryResource

public function updateLock(int $post_id, Request $request)
{

$post = $this->queryBus->handle(new FindPostByIdQuery($post_id, ['id', 'user_id', 'form_id']));
$post = $this->getPost($post_id, ['id', 'status','user_id','form_id'], []);
$this->authorize('update', $post);

$this->commandBus->handle(new UpdatePostLockCommand($post_id));
Expand All @@ -491,7 +490,7 @@ public function updateLock(int $post_id, Request $request)

public function deleteLock(int $post_id, Request $request)
{
$post = $this->queryBus->handle(new FindPostByIdQuery($post_id, ['id', 'user_id', 'form_id']));
$post = $this->getPost($post_id, ['id', 'status','user_id','form_id'], []);
$this->authorize('update', $post);

$this->commandBus->handle(new DeletePostLockCommand($post_id));
Expand Down

0 comments on commit 2a40f05

Please sign in to comment.