|
@@ -1,5 +1,5 @@
|
|
|
+import { DashboardService } from './../../../shared/dashboard.service';
|
|
|
import { Modal } from 'ngx-modialog/plugins/bootstrap';
|
|
|
-import { LectureService } from './../../../shared/lecture.service';
|
|
|
import { AuthServiceService } from './../../../shared/auth-service.service';
|
|
|
import { UserService } from './../../../shared/user.service';
|
|
|
import { HttpClient } from '@angular/common/http';
|
|
@@ -23,7 +23,7 @@ export class LecturesListComponent implements OnInit {
|
|
|
private toastr: ToastrService,
|
|
|
private http: HttpClient,
|
|
|
private modal: Modal,
|
|
|
- private lectureService: LectureService,
|
|
|
+ private dashbordSer: DashboardService,
|
|
|
private router: Router) { }
|
|
|
|
|
|
pageId: number;
|
|
@@ -98,7 +98,7 @@ export class LecturesListComponent implements OnInit {
|
|
|
);
|
|
|
|
|
|
//get list data
|
|
|
- this.lectureService.getLecturesList(this.pageId, this.currentPage ,this.dataTableNumber).subscribe(
|
|
|
+ this.dashbordSer.getListData(this.pageId, this.currentPage ,this.dataTableNumber).subscribe(
|
|
|
(responce) => {
|
|
|
console.log(responce);
|
|
|
this.lecturesList = responce['lectures'];
|
|
@@ -135,7 +135,7 @@ export class LecturesListComponent implements OnInit {
|
|
|
this.lecturesList = [];
|
|
|
//console.log(pagenationNumber);
|
|
|
//console.log(this.pageId);
|
|
|
- this.lectureService.getLecturesList(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
|
|
|
+ this.dashbordSer.getListData(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
|
|
|
(responce) => {
|
|
|
console.log(responce);
|
|
|
this.lecturesList = responce['lectures'];
|
|
@@ -158,7 +158,7 @@ export class LecturesListComponent implements OnInit {
|
|
|
this.currentPage = 1;
|
|
|
console.log('search curent page', this.currentPage);
|
|
|
console.log('search page id', this.pageId);
|
|
|
- this.lectureService.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
|
|
|
+ this.dashbordSer.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
|
|
|
(responce) => {
|
|
|
console.log(responce);
|
|
|
this.lecturesList = responce['lectures'];
|
|
@@ -182,7 +182,7 @@ export class LecturesListComponent implements OnInit {
|
|
|
this.http.post(this.authSer.pathApi + '/rank_lecture', data).subscribe(
|
|
|
(responce) => {
|
|
|
console.log(responce);
|
|
|
- this.lectureService.getLecturesList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
|
|
|
+ this.dashbordSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
|
|
|
(responce) => {
|
|
|
console.log(responce);
|
|
|
this.count = responce['count'];
|
|
@@ -205,7 +205,7 @@ onGetValue(event) {
|
|
|
this.spinner.show();
|
|
|
this.lecturesList = [];
|
|
|
this.dataTableNumber = event.target.value;
|
|
|
- this.lectureService.getLecturesList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
|
|
|
+ this.dashbordSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
|
|
|
(responce) => {
|
|
|
console.log(responce);
|
|
|
this.lecturesList = responce['lectures'];
|
|
@@ -242,13 +242,13 @@ onGetValue(event) {
|
|
|
.open();
|
|
|
dialogRef.result
|
|
|
.then( result =>
|
|
|
- this.lectureService.deleteLecture(this.lecturesListIds).subscribe(
|
|
|
+ this.dashbordSer.deleteItem(this.lecturesListIds, this.pageId).subscribe(
|
|
|
(responce) => {
|
|
|
console.log(responce);
|
|
|
this.toastr.success('تم الحذف');
|
|
|
this.spinner.show();
|
|
|
this.lecturesList = [];
|
|
|
- this.lectureService.getLecturesList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
|
|
|
+ this.dashbordSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
|
|
|
(responce) => {
|
|
|
console.log(responce);
|
|
|
this.lecturesList = responce['lectures'];
|