Skip to content
Snippets Groups Projects
Commit 31cff498 authored by Ole-Christian Bjerkeset's avatar Ole-Christian Bjerkeset
Browse files

Added comments in the profile.js file

parent 5b2b6022
No related branches found
No related tags found
No related merge requests found
Pipeline #166507 passed
......@@ -9,7 +9,7 @@ function handleCancelButtonDuringCreate() {
}
/**
* If user presses "cancel" during editing a group the
* If user presses "cancel" during editing the profile the
* form fields become read only and the form data is deleted.
* And the buttons change.
*/
......@@ -35,7 +35,7 @@ function handleCancelButtonDuringEdit() {
/**
* If the user clicks on the edit button the form fields can be edited.
* And the form is updated with the data of the group that the user wants to edit.
* And the form is updated with the profile data the user wants to change.
*/
function handleEditProfileButtonClick() {
setReadOnly(false, "#form-profile");
......@@ -82,8 +82,7 @@ async function getCurrentProfile() {
}
/**
* Sends a PUT request to the API to update a group's information.
* @param {integer} id of the group to be updated
* Sends a PUT request to the API to update the active users profile information.
*/
async function updateProfile() {
let res = await sendRequest("GET", `${HOST}/api/users/?user=current`);
......@@ -123,9 +122,7 @@ async function updateProfile() {
}
/**
* When a user enters the group.html this decides whether it
* is entered in view/edit mode or in create mode. If the html contains
* a url parameter with an id it is entered in view/edit mode.
* When a user enters the profile.html his/her profile information is retrieved
*/
window.addEventListener("DOMContentLoaded", async () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment