parent
a7e47f98d2
commit
6406c624c3
@ -1 +1,2 @@ |
||||
<app-nav-menu></app-nav-menu> |
||||
<h2>Liste de vos notes</h2> |
@ -1,17 +1,52 @@ |
||||
import { Component, OnInit } from "@angular/core"; |
||||
import { NotesService } from "@shared/api-swagger"; |
||||
import { CollaborateurDTO, NotesService } from "@shared/api-swagger"; |
||||
import { cles } from "@shared/utils/cles"; |
||||
import { Subscription } from "rxjs"; |
||||
|
||||
@Component({ |
||||
selector: "app-notes", |
||||
templateUrl: "./notes.component.html" |
||||
}) |
||||
export class NotesComponent implements OnInit { |
||||
|
||||
|
||||
|
||||
|
||||
asc: boolean = true; |
||||
|
||||
numPage: number = 1; |
||||
|
||||
parPage: number= 15; |
||||
|
||||
texte: string = ""; |
||||
|
||||
tri: string = ""; |
||||
|
||||
|
||||
notesSubscriber: Subscription; |
||||
|
||||
id: string; |
||||
constructor(private notesService: NotesService) { |
||||
|
||||
} |
||||
|
||||
ngOnInit() {} |
||||
ngOnInit() { |
||||
this.recupererId(); |
||||
} |
||||
|
||||
recupererId() { |
||||
if(sessionStorage.getItem(cles.sessionKeyConnectee) == undefined){ |
||||
setTimeout( () => this.recupererId(), 1000); |
||||
} |
||||
else { |
||||
const collaborateurConnecte : CollaborateurDTO = JSON.parse(sessionStorage.getItem(cles.sessionKeyConnectee)); |
||||
this.id = collaborateurConnecte.id; |
||||
this.updateDataSource(); |
||||
} |
||||
} |
||||
|
||||
updateDataSource() { |
||||
this.notesSubscriber = this.notesService.getNotesAuteur(this.id, this.asc, this.numPage, this.parPage, this.texte, this.tri).subscribe( |
||||
notes => { console.log(notes)}, |
||||
err => console.log(err) |
||||
); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue