Skip to content
Snippets Groups Projects
Commit deb3e4b0 authored by George Adrian Stoica's avatar George Adrian Stoica
Browse files

fix: make jetty enpoint expect newn name as form param

parent bc2ddf5f
No related branches found
No related tags found
No related merge requests found
......@@ -2,13 +2,13 @@ package todolist.restapi;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.DELETE;
import jakarta.ws.rs.FormParam;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.NotFoundException;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.PUT;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.core.Context;
import jakarta.ws.rs.core.MediaType;
import java.io.IOException;
......@@ -114,7 +114,8 @@ public class TodoListResource {
*/
@POST
@Path("/rename")
public boolean renameTodoList(@QueryParam("newName") String newName) {
@Consumes("application/x-www-form-urlencoded")
public boolean renameTodoList(@FormParam("newName") String newName) {
checkTodoList();
if (this.todoModel.getTodoList(newName) != null) {
throw new IllegalArgumentException("A TodoList named \"" + newName + "\" already exists");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment