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