commencement de la connexion avec le back de 'user/myProfil' et de 'user/myPlaylists'

This commit is contained in:
MiharyR 2021-12-11 21:22:27 +01:00
parent cf3c596c7b
commit 7f6d089f1d
20 changed files with 279 additions and 149 deletions

View file

@ -6,7 +6,6 @@ import {MessageService} from "../../../utils/services/message/message.service";
import {map, startWith} from "rxjs/operators";
import {MatChipInputEvent} from "@angular/material/chips";
import {MatAutocompleteSelectedEvent} from "@angular/material/autocomplete";
import {FictitiousUtilsService} from "../../../utils/services/fictitiousDatas/fictitiousUtils/fictitious-utils.service";
@ -28,8 +27,7 @@ export class InputInterestsProfilComponent implements OnInit
@ViewChild('tagInput') tagInput: ElementRef<HTMLInputElement>;
constructor( private fictitiousUtilsService: FictitiousUtilsService,
private messageService: MessageService ) {}
constructor( private messageService: MessageService ) {}
ngOnInit(): void
@ -38,9 +36,19 @@ export class InputInterestsProfilComponent implements OnInit
startWith(null),
map((fruit: string | null) => fruit ? this._filter(fruit) : this.allInterests.slice()));
// --- FAUX CODE ---
this.allInterests = this.fictitiousUtilsService.getTags();
this.allInterests.sort();
this.messageService
.get("misc/getInterests")
.subscribe( retour => {
if(retour.status !== "success") {
console.log(retour);
}
else {
this.allInterests = [];
for(let elt of retour.data) this.allInterests.push(elt.interest);
this.allInterests.sort();
}
});
}