diff --git a/js/projet_detail.js b/js/projet_detail.js index f1e9dae..6cf46d4 100644 --- a/js/projet_detail.js +++ b/js/projet_detail.js @@ -163,9 +163,12 @@ document.addEventListener("DOMContentLoaded", async () => { alert('Nouvelle vidéo enregistrée :\nNom : ' + nameVideo + '\nRésolution : ' + videoResolution + '\nDurée : ' + videoDuration + ' secondes'); - }).then(()=>{ + }).then((data)=>{ + console.log(data); + console.log(" ") getDataProjectVideosFromApi(projectId).then((data)=>{ - console.log(data) + idVideo = data[data.length-1].id + console.log(idVideo) renderVideo(idVideo) }) }) diff --git a/js/utilities/routes.js b/js/utilities/routes.js index c9aeb41..73a3aa5 100644 --- a/js/utilities/routes.js +++ b/js/utilities/routes.js @@ -102,6 +102,7 @@ async function postNewVideo(project_id, measurements_id, name_video, resolution, }); alert("Video posted successfully:", response); + location.reload(); } catch (error) { alert("Error posting video:", error); throw error; @@ -125,6 +126,7 @@ async function PostNewProject(nameProject, description){ }); alert("Video posted successfully:", response); + location.reload(); } catch (error) { alert("Error posting video:", error); throw error; @@ -138,6 +140,7 @@ async function deleteProject(id){ method: "DELETE", }).then(()=>{ alert("Projet supprimé avec succès") + location.reload(); }) } catch (error) { alert("Error deleting project, project id :"+ id+"\n error :"+error); @@ -151,6 +154,7 @@ async function deleteVideo(id){ method: "DELETE", }).then(()=>{ alert("Video supprimé avec succès") + location.reload(); }) } catch (error) { alert("Error deleting video, video id :"+ id+"\n error :"+error);