|
@@ -107,7 +107,7 @@ export class SupervisorAddComponent implements OnInit {
|
|
|
console.log(responce);
|
|
|
this.supervisorList = responce['users'];
|
|
|
if(this.supervisorList.length == 0) {
|
|
|
- this.toastr.warning(' القسم ليس لديه مستخدمين !');
|
|
|
+ this.toastr.warning(' القسم ليس لديه مشرفين !');
|
|
|
}
|
|
|
},
|
|
|
(error) => {
|
|
@@ -135,29 +135,31 @@ export class SupervisorAddComponent implements OnInit {
|
|
|
)
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
onSubmitted(form: NgForm) {
|
|
|
this.formData = form.value;
|
|
|
- if(this.supervisorId){
|
|
|
- this.formData['department_id'] = this.superDeaprt.department_id;
|
|
|
- }
|
|
|
+ // if(this.supervisorId){
|
|
|
+ // this.formData['department_id'] = this.superDeaprt.department_id;
|
|
|
+ // }
|
|
|
console.log(this.formData);
|
|
|
- this.dashboardService.addItem(this.formData, 'supervisor').subscribe(
|
|
|
- (responce) => {
|
|
|
- console.log(responce);
|
|
|
- this.checkSaveClick = false;
|
|
|
- if(this.supervisorId) {
|
|
|
- this.toastr.success('تمت التعديل بنجاح');
|
|
|
- } else {
|
|
|
- this.toastr.success('تمت الاضافه بنجاح');
|
|
|
- }
|
|
|
- this.location.back();
|
|
|
- },
|
|
|
- (error) => {
|
|
|
- console.log(error);
|
|
|
- this.checkSaveClick = false;
|
|
|
- this.toastr.error('خطأ في الحفظ !');
|
|
|
- }
|
|
|
- );
|
|
|
+ // this.dashboardService.addItem(this.formData, 'supervisor').subscribe(
|
|
|
+ // (responce) => {
|
|
|
+ // console.log(responce);
|
|
|
+ // this.checkSaveClick = false;
|
|
|
+ // if(this.supervisorId) {
|
|
|
+ // this.toastr.success('تمت التعديل بنجاح');
|
|
|
+ // } else {
|
|
|
+ // this.toastr.success('تمت الاضافه بنجاح');
|
|
|
+ // }
|
|
|
+ // this.location.back();
|
|
|
+ // },
|
|
|
+ // (error) => {
|
|
|
+ // console.log(error);
|
|
|
+ // this.checkSaveClick = false;
|
|
|
+ // this.toastr.error('خطأ في الحفظ !');
|
|
|
+ // }
|
|
|
+ // );
|
|
|
}
|
|
|
|
|
|
}
|