Skip to content

Commit

Permalink
Fix activities mass action destroy.
Browse files Browse the repository at this point in the history
  • Loading branch information
suraj-webkul committed Sep 26, 2024
1 parent e1ec37c commit e9e706e
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Webkul\Activity\Repositories\FileRepository;
use Webkul\Admin\DataGrids\Activity\ActivityDataGrid;
use Webkul\Admin\Http\Controllers\Controller;
use Webkul\Admin\Http\Requests\MassDestroyRequest;
use Webkul\Admin\Http\Requests\MassUpdateRequest;
use Webkul\Admin\Http\Resources\ActivityResource;
use Webkul\Attribute\Repositories\AttributeRepository;
Expand Down Expand Up @@ -216,9 +217,9 @@ public function destroy(int $id): JsonResponse
/**
* Mass Delete the specified resources.
*/
public function massDestroy(MassUpdateRequest $massUpdateRequest): JsonResponse
public function massDestroy(MassDestroyRequest $massDestroyRequest): JsonResponse
{
$activities = $this->activityRepository->findWhereIn('id', $massUpdateRequest->input('indices'));
$activities = $this->activityRepository->findWhereIn('id', $massDestroyRequest->input('indices'));

try {
foreach ($activities as $activity) {
Expand All @@ -230,11 +231,11 @@ public function massDestroy(MassUpdateRequest $massUpdateRequest): JsonResponse
}

return response()->json([
'message' => trans('admin::app.response.destroy-success'),
'message' => trans('admin::app.activities.mass-destroy-success'),
]);
} catch (\Exception $exception) {
return response()->json([
'message' => trans('admin::app.response.destroy-failed'),
'message' => trans('admin::app.activities.mass-delete-failed'),
], 400);
}
}
Expand Down
8 changes: 5 additions & 3 deletions packages/Webkul/Admin/src/Resources/lang/ar/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -1540,13 +1540,15 @@

'updated' => 'تم تحديث :attribute',
'created' => 'تم الإنشاء',
'duration-overlapping' => 'المشاركون لديهم اجتماع آخر في هذا الوقت. هل تريد المتابعة؟',
'duration-overlapping' => 'لدى المشاركين اجتماع آخر في هذا الوقت. هل تريد المتابعة؟',
'create-success' => 'تم إنشاء النشاط بنجاح.',
'update-success' => 'تم تحديث النشاط بنجاح.',
'overlapping-error' => 'المشاركون لديهم اجتماع آخر في هذا الوقت.',
'mass-update-success' => 'تم تحديث الأنشطة بنجاح.',
'overlapping-error' => 'لدى المشاركين اجتماع آخر في هذا الوقت.',
'destroy-success' => 'تم حذف النشاط بنجاح.',
'delete-failed' => 'لا يمكن حذف النشاط.',
'mass-update-success' => 'تم تحديث الأنشطة بنجاح.',
'mass-destroy-success' => 'تم حذف الأنشطة بنجاح.',
'mass-delete-failed' => 'لا يمكن حذف الأنشطة.',
],

'mail' => [
Expand Down
4 changes: 3 additions & 1 deletion packages/Webkul/Admin/src/Resources/lang/en/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -1544,9 +1544,11 @@
'create-success' => 'Activity created successfully.',
'update-success' => 'Activity updated successfully.',
'overlapping-error' => 'Participants have another meeting at this time.',
'mass-update-success' => 'Activities updated successfully.',
'destroy-success' => 'Activity deleted successfully.',
'delete-failed' => 'Activity can not be deleted.',
'mass-update-success' => 'Activities updated successfully.',
'mass-destroy-success' => 'Activities deleted successfully.',
'mass-delete-failed' => 'Activities can not be deleted.',
],

'mail' => [
Expand Down
8 changes: 5 additions & 3 deletions packages/Webkul/Admin/src/Resources/lang/es/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -1540,13 +1540,15 @@

'updated' => 'Actualizado :attribute',
'created' => 'Creado',
'duration-overlapping' => 'Los participantes tienen otra reunión a esta hora. ¿Desea continuar?',
'duration-overlapping' => 'Los participantes tienen otra reunión en este momento. ¿Deseas continuar?',
'create-success' => 'Actividad creada con éxito.',
'update-success' => 'Actividad actualizada con éxito.',
'overlapping-error' => 'Los participantes tienen otra reunión a esta hora.',
'mass-update-success' => 'Actividades actualizadas con éxito.',
'overlapping-error' => 'Los participantes tienen otra reunión en este momento.',
'destroy-success' => 'Actividad eliminada con éxito.',
'delete-failed' => 'No se puede eliminar la actividad.',
'mass-update-success' => 'Actividades actualizadas con éxito.',
'mass-destroy-success' => 'Actividades eliminadas con éxito.',
'mass-delete-failed' => 'No se pueden eliminar las actividades.',
],

'mail' => [
Expand Down
10 changes: 6 additions & 4 deletions packages/Webkul/Admin/src/Resources/lang/fa/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -1538,15 +1538,17 @@
'users' => 'کاربران',
],

'updated' => 'به‌روزرسانی شده :attribute',
'created' => 'ایجاد شده',
'updated' => 'به‌روزرسانی شد :attribute',
'created' => 'ایجاد شد',
'duration-overlapping' => 'شرکت‌کنندگان در این زمان جلسه دیگری دارند. آیا می‌خواهید ادامه دهید؟',
'create-success' => 'فعالیت با موفقیت ایجاد شد.',
'update-success' => 'فعالیت با موفقیت به‌روزرسانی شد.',
'overlapping-error' => 'شرکت‌کنندگان در این زمان جلسه دیگری دارند.',
'mass-update-success' => 'فعالیت‌ها با موفقیت به‌روزرسانی شدند.',
'destroy-success' => 'فعالیت با موفقیت حذف شد.',
'delete-failed' => 'فعالیت قابل حذف نیست.',
'delete-failed' => 'امکان حذف فعالیت وجود ندارد.',
'mass-update-success' => 'فعالیت‌ها با موفقیت به‌روزرسانی شدند.',
'mass-destroy-success' => 'فعالیت‌ها با موفقیت حذف شدند.',
'mass-delete-failed' => 'امکان حذف فعالیت‌ها وجود ندارد.',
],

'mail' => [
Expand Down
12 changes: 7 additions & 5 deletions packages/Webkul/Admin/src/Resources/lang/tr/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -1538,15 +1538,17 @@
'users' => 'Kullanıcılar',
],

'updated' => ':attribute güncellendi',
'updated' => 'Güncellendi :attribute',
'created' => 'Oluşturuldu',
'duration-overlapping' => 'Katılımcıların bu zamanda başka bir toplantısı var. Devam etmek istiyor musunuz?',
'duration-overlapping' => 'Katılımcıların bu saatte başka bir toplantısı var. Devam etmek istiyor musunuz?',
'create-success' => 'Etkinlik başarıyla oluşturuldu.',
'update-success' => 'Etkinlik başarıyla güncellendi.',
'overlapping-error' => 'Katılımcıların bu zamanda başka bir toplantısı var.',
'mass-update-success' => 'Etkinlikler başarıyla güncellendi.',
'overlapping-error' => 'Katılımcıların bu saatte başka bir toplantısı var.',
'destroy-success' => 'Etkinlik başarıyla silindi.',
'delete-failed' => 'Etkinlik silinemedi.',
'delete-failed' => 'Etkinlik silinemiyor.',
'mass-update-success' => 'Etkinlikler başarıyla güncellendi.',
'mass-destroy-success' => 'Etkinlikler başarıyla silindi.',
'mass-delete-failed' => 'Etkinlikler silinemiyor.',
],

'mail' => [
Expand Down

0 comments on commit e9e706e

Please sign in to comment.