diff --git a/_includes/create_user.html b/_includes/create_user.html index 3d284102f..43fb31039 100644 --- a/_includes/create_user.html +++ b/_includes/create_user.html @@ -1,10 +1,4 @@ - - - - Create User - -

@@ -35,7 +29,7 @@ }; try { - const response = await fetch('http://127.0.0.1:8086/api/user', { + const response = await fetch('http://127.0.0.1:8087/api/user', { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -55,5 +49,4 @@ } } - diff --git a/assets/js/api/config.js b/assets/js/api/config.js index a5dbc68a7..02d5e30d6 100644 --- a/assets/js/api/config.js +++ b/assets/js/api/config.js @@ -1,12 +1,11 @@ export var pythonURI; if (location.hostname === "localhost") { - pythonURI = "http://localhost:8086"; + pythonURI = "http://localhost:8087"; } else if (location.hostname === "127.0.0.1") { - pythonURI = "http://127.0.0.1:8086"; + pythonURI = "http://127.0.0.1:8087"; } else { - pythonURI = "http://127.0.0.1:8086"; + pythonURI = "http://127.0.0.1:8087"; } - export var javaURI; if (location.hostname === "localhost") { javaURI = "http://localhost:8085"; diff --git a/navigation/authentication/profile.md b/navigation/authentication/profile.md index d91666a83..1b2965965 100644 --- a/navigation/authentication/profile.md +++ b/navigation/authentication/profile.md @@ -1,309 +1,417 @@ --- layout: base -title: Profile S +title: Profile Setup permalink: /profile search_exclude: true --- -{% include nav/home.html %} - - -
- - + - - // Function to convert file to base64 string - function convertToBase64(file) { - return new Promise((resolve, reject) => { - const reader = new FileReader(); - reader.readAsDataURL(file); - reader.onload = () => resolve(reader.result.split(',')[1]); - reader.onerror = error => reject(error); - }); - } - // Function to send profile picture to server - async function sendProfilePicture(base64String) { - const URL = `${pythonURI}/api/id/pfp`; // Adjust endpoint as needed - const options = { - ...fetchOptions, - method: 'POST', - body: JSON.stringify({ base64String }), - }; - const response = await fetch(URL, options); - if (!response.ok) { - throw new Error(`Failed to upload profile picture: ${response.status}`); - } - // Handle success response as needed - } - - // Function to save sections (example action) - function saveSections() { - const URL = `${pythonURI}/api/user/section`; // Adjusted endpoint - - const sectionsData = { - sections: userSections - }; - - const options = { - ...fetchOptions, - method: 'POST', - headers: { - ...fetchOptions.headers, - 'Content-Type': 'application/json', - }, - body: JSON.stringify(sectionsData) - }; - - fetch(URL, options) - .then(response => { - if (!response.ok) { - throw new Error(`Failed to save sections: ${response.status}`); - } - // Handle success response as needed - console.log('Sections saved successfully!'); - }) - .catch(error => { - console.error('Error saving sections:', error.message); - // Handle error display or fallback mechanism - }); - } -