footer.service.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import { AuthServiceService } from './auth-service.service';
  2. import { HttpClient } from '@angular/common/http';
  3. import { Injectable } from '@angular/core';
  4. import { NgxSpinnerService } from 'ngx-spinner';
  5. import { ToastrService } from 'ngx-toastr';
  6. @Injectable({
  7. providedIn: 'root'
  8. })
  9. export class FooterService {
  10. constructor(private http: HttpClient,
  11. private spinner: NgxSpinnerService,
  12. private toastr: ToastrService,
  13. private authService: AuthServiceService) { }
  14. //get externals list
  15. getFooterList(pageId: number, currentPage: number, dataTableNumber: number){
  16. this.spinner.show();
  17. console.log(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
  18. return this.http.get(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
  19. }
  20. //get data data from searchBar
  21. getDataUSerSearchBar(data, pageId, pagenationNumber, dataTableNumber) {
  22. console.log('url', this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
  23. return this.http.get(this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
  24. }
  25. //delete data
  26. deleteFooter(footersId) {
  27. console.log(footersId);
  28. return this.http.post(this.authService.pathApi + '/delete_footers' , {'footers_id' : footersId});
  29. };
  30. //add external
  31. addFooter(dataExternals) {
  32. console.log(dataExternals);
  33. return this.http.post(this.authService.pathApi + '/add_footer', dataExternals);
  34. }
  35. //get external data
  36. getFooterData(externalId: number) {
  37. return this.http.get(this.authService.pathApi + '/get_footer/' + externalId);
  38. };
  39. //edit extrnal
  40. editFooter( dataRoleEdit,EditRoleId){
  41. const editData = dataRoleEdit;
  42. editData.id = EditRoleId;
  43. console.log(editData);
  44. return this.http.post(this.authService.pathApi + '/edit_footer', editData);
  45. }
  46. }