Skip to content

Commit

Permalink
Merge pull request #33 from tomatophp/develop
Browse files Browse the repository at this point in the history
notification on like / dislike
  • Loading branch information
3x1io authored Mar 27, 2024
2 parents 7b66559 + 507cc90 commit 5341844
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions Modules/CircleXO/App/Http/Controllers/CircleXOController.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,13 @@ public function like($username, $post)
->first();

if($post){

$post->account->notifyDB(
message: __(auth('accounts')->user()->username . " " . __('is like your listing') .' '. $post->title),
title: __('New Like'),
url: url(auth('accounts')->user()->username)
);
if($post->account->id !== auth('accounts')->user()->id) {
$post->account->notifyDB(
message: __(auth('accounts')->user()->username . " " . __('is like your listing') . ' ' . $post->title),
title: __('New Like'),
url: url(auth('accounts')->user()->username)
);
}

auth('accounts')->user()->like($post);
return back();
Expand All @@ -189,11 +190,13 @@ public function unlike($username, $post)
->first();

if($post){
$post->account->notifyDB(
message: __(auth('accounts')->user()->username . " " . __('is dislike your listing') .' '. $post->title),
title: __('New Dislike'),
url: url(auth('accounts')->user()->username)
);
if($post->account->id !== auth('accounts')->user()->id){
$post->account->notifyDB(
message: __(auth('accounts')->user()->username . " " . __('is dislike your listing') .' '. $post->title),
title: __('New Dislike'),
url: url(auth('accounts')->user()->username)
);
}

auth('accounts')->user()->unlike($post);
return back();
Expand Down

0 comments on commit 5341844

Please sign in to comment.