Make rendus page more interactive
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
nemunaire 2022-11-20 15:53:50 +01:00
commit ce6141e6e0
3 changed files with 39 additions and 13 deletions

View file

@ -15,8 +15,14 @@ export class WorkRepository {
this.already_used = already_used == true;
}
async delete() {
const res = await fetch(this.id_work?`api/works/${this.id_work}/repositories/${this.id}`:`api/repositories/${this.id}`, {
async delete(userid) {
let url = this.id_work?`works/${this.id_work}/repositories/${this.id}`:`repositories/${this.id}`;
if (userid) {
url = `users/${userid}/` + url;
}
const res = await fetch("api/" + url, {
method: 'DELETE',
headers: {'Accept': 'application/json'}
});