Merge remote-tracking branch 'Prateek/mass-update-review'

This commit is contained in:
Sanjay 2022-02-16 19:14:41 +05:30
commit 3ed9994163
2 changed files with 19 additions and 17 deletions

View File

@ -11,10 +11,6 @@
.table td.actions .icon {
margin-top: 8px;
}
.table td.actions .icon.pencil-lg-icon {
margin-right: 10px;
}
</style>
@endpush
@ -342,7 +338,7 @@
<a :href="['{{ route('admin.catalog.products.index') }}/edit/' + variant.id]">
<i class="icon pencil-lg-icon"></i>
</a>
<i class="icon remove-icon" @click="removeVariant()"></i>
</td>
</tr>

View File

@ -155,20 +155,26 @@ class ReviewController extends Controller
$review = $this->productReviewRepository->findOneByField('id', $value);
try {
if ($data['massaction-type'] == 'update') {
if ($data['update-options'] == 1) {
Event::dispatch('customer.review.update.before', $value);
if (! isset($data['massaction-type'])) {
return redirect()->back();
}
$review->update(['status' => 'approved']);
if (! $data['massaction-type'] == 'update') {
return redirect()->back();
}
Event::dispatch('customer.review.update.after', $review);
} elseif ($data['update-options'] == 0) {
$review->update(['status' => 'pending']);
} elseif ($data['update-options'] == 2) {
$review->update(['status' => 'disapproved']);
} else {
continue;
}
if ($data['update-options'] == 1) {
Event::dispatch('customer.review.update.before', $value);
$review->update(['status' => 'approved']);
Event::dispatch('customer.review.update.after', $review);
} elseif ($data['update-options'] == 0) {
$review->update(['status' => 'pending']);
} elseif ($data['update-options'] == 2) {
$review->update(['status' => 'disapproved']);
} else {
continue;
}
} catch (\Exception $e) {
$suppressFlash = true;