anto
This commit is contained in:
@@ -82,7 +82,6 @@ async function postNewVideo(project_id, measurements_id, name_video, resolution,
|
||||
resolution: resolution,
|
||||
duration: duration
|
||||
});
|
||||
console.log(mydata);
|
||||
|
||||
const response = await $.ajax({
|
||||
url: api_url.concat(`/videos/`),
|
||||
@@ -98,18 +97,23 @@ async function postNewVideo(project_id, measurements_id, name_video, resolution,
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async function getVideoFromApi(id) {
|
||||
async function PostNewProject(nameProject, description){
|
||||
try {
|
||||
const response = await $.ajax({
|
||||
url: api_url.concat(`/cat/`),
|
||||
method: "GET",
|
||||
dataType: "json",
|
||||
const mydata = JSON.stringify({
|
||||
name: nameProject,
|
||||
description: description
|
||||
});
|
||||
// If the request is successful, store the data in the cache and return it
|
||||
return response;
|
||||
const response = await $.ajax({
|
||||
url: api_url.concat(`/projects`),
|
||||
method: "POST",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: mydata
|
||||
});
|
||||
|
||||
console.log("Video posted successfully:", response);
|
||||
} catch (error) {
|
||||
console.error("Error fetching data:", error);
|
||||
throw error; // Re-throw the error to handle it outside the function if needed
|
||||
console.error("Error posting video:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,8 @@ function checkVideoPath(videos, name) {
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getMeasurementsIdsFromForm(choice, firstInput, lastInput) {
|
||||
if (choice === 'oneByOne') {
|
||||
const highlightedButtons = document.querySelectorAll('.number-button.highlight');
|
||||
|
||||
Reference in New Issue
Block a user