mis à jour work
continuous-integration/drone/push Build is failing Details

pull/15/head
Matis MAZINGUE 11 months ago
parent 1f607b9c2b
commit f94e9e7634

@ -0,0 +1 @@
Subproject commit 74a68d9743e012636495f0ae3ac630739083f087

@ -20,26 +20,24 @@ export class WorkService {
return this.http.get(`${this.API_URL}/works`); return this.http.get(`${this.API_URL}/works`);
} }
//je veux return un work en fonction d'un link passé en param getWorksByUser //je veux return les works d'un user id
getWorkByLink(link: string): Observable<any> { getWorksByUserId(user_id: string): Observable<any> {
return this.http.get(`${this.API_URL}/work/${link}`); return this.http.get(`${this.API_URL}/works/${user_id}`);
} }
//je veux return le link du dernier work d'un user (en l'occurence celui connecté) //je veux return le link du dernier work d'un user (en l'occurence celui connecté)
getLinkLastWorkByIdUser(id_user: string): Observable<any> { getLastWorkByUserId(user_id: string): Observable<any> {
return this.http.get(`${this.API_URL}/work/${id_user}`); return this.http.get(`${this.API_URL}/work/${user_id}`);
} }
postWork(form: NgForm): void { postWork(form: NgForm): void {
let body = {link: crypto.randomUUID(), id_user: 1, id_language: 1, code: form.value.content, saveDate: new Date()} let body = {link: crypto.randomUUID(), user_id: 1, id_language: 1, code: form.value.content, saveDate: new Date()}
this.http.post<any>(`${this.API_URL}/works`, body).subscribe(); this.http.post<any>(`${this.API_URL}/works`, body).subscribe();
} }
postWorkCode(code: string): void { postWorkCode(code: string): void {
let body = {link: crypto.randomUUID(), id_user: 1, id_language: 1, code: code} let body = {link: crypto.randomUUID(), user_id: 1, id_language: 1, code: code}
this.http.post<any>(`${this.API_URL}/works`, body).subscribe(); this.http.post<any>(`${this.API_URL}/works`, body).subscribe();
} }
getIdLastWorkByUserId(id_user: string): string { return ""}
} }
Loading…
Cancel
Save