@elite.framework/ng.core 1.0.51 → 1.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6440,11 +6440,20 @@ class BaseCrud {
|
|
|
6440
6440
|
const id = item[this.idField];
|
|
6441
6441
|
this.swalService.confirm('تأكيد الحذف', 'هل تريد حذف هذا السجل فعلاً؟', 'نعم، احذف', 'إلغاء').then((result) => {
|
|
6442
6442
|
if (result.isConfirmed) {
|
|
6443
|
-
this.service.delete(id).subscribe(
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6443
|
+
this.service.delete(id).subscribe({
|
|
6444
|
+
next: () => {
|
|
6445
|
+
this.loadPage(0, this.rows);
|
|
6446
|
+
this.swalService.success('تم الحذف بنجاح');
|
|
6447
|
+
},
|
|
6448
|
+
error: (err) => {
|
|
6449
|
+
this.loading = false;
|
|
6450
|
+
const msg = err.error?.title ||
|
|
6451
|
+
err.message ||
|
|
6452
|
+
'حدث خطأ أثناء الحفظ. يرجى المحاولة مرة أخرى.';
|
|
6453
|
+
// this.errorMessage = msg;
|
|
6454
|
+
// ❌ رسالة خطأ
|
|
6455
|
+
this.swalService.error('فشل الحذف', msg);
|
|
6456
|
+
}
|
|
6448
6457
|
});
|
|
6449
6458
|
}
|
|
6450
6459
|
});
|