Merge remote-tracking branch 'Prateek/mass-update-review'
This commit is contained in:
commit
3ed9994163
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue