Home HTML/JavaScript for User Profile
Post
Cancel

HTML/JavaScript for User Profile

Update/Delete User Info

In this section we will be explaining how data for the user would be updated and deleted in the Java Springboot backend.

First, make sure you have this repository cloned so that you can see the code working in real time: git clone https://github.com/CSA-AI/CSA_AI_lessonBackend.git

Update Through API Requests

This is how the user would update data specific to their profile using a PUT request which communicates to the Springboot server.

Image

  • putmapping then we put the url that we wantt to go to thru response entity
  • we use the things that we wanna modify
  • findbyEmail, how we find the person (thru JPA repo)
  • JPA set functions, modifying the parts of the things we want
  • creates a new person object (person), searches for the object that has the same email in the database, then edit the specific values in the db and saves it

Password Update




Delete

searches by id and deletes that entire person object

User Delete




This post is licensed under CC BY 4.0 by the author.

Spring Roles for User/Admin

Thymeleaf Lesson