diff --git a/src/main/resources/html/index.html b/src/main/resources/html/index.html index a2c1d1e..001d61a 100644 --- a/src/main/resources/html/index.html +++ b/src/main/resources/html/index.html @@ -124,7 +124,7 @@ password: passwordInput.val(), permission: "admin", }), - type: "PUT", + type: "POST", contentType: "application/json", dataType: "json", success: function (data) { diff --git a/src/main/scala/me/arcanis/ffxivbis/http/Swagger.scala b/src/main/scala/me/arcanis/ffxivbis/http/Swagger.scala index a7c60fb..878953f 100644 --- a/src/main/scala/me/arcanis/ffxivbis/http/Swagger.scala +++ b/src/main/scala/me/arcanis/ffxivbis/http/Swagger.scala @@ -49,5 +49,5 @@ class Swagger(config: Config) extends SwaggerHttpService { override val securitySchemes: Map[String, SecurityScheme] = Map("basic" -> basicAuth) override val unwantedDefinitions: Seq[String] = - Seq("Function1", "Function1RequestContextFutureRouteResult") + Seq("Function1", "Function1RequestContextFutureRouteResult", "SeqLootModel", "SeqPieceModel") } diff --git a/src/main/scala/me/arcanis/ffxivbis/http/api/v1/UserEndpoint.scala b/src/main/scala/me/arcanis/ffxivbis/http/api/v1/UserEndpoint.scala index 4aee9db..8b05666 100644 --- a/src/main/scala/me/arcanis/ffxivbis/http/api/v1/UserEndpoint.scala +++ b/src/main/scala/me/arcanis/ffxivbis/http/api/v1/UserEndpoint.scala @@ -38,7 +38,7 @@ class UserEndpoint(override val storage: ActorRef[Message], override val auth: A def routes: Route = createParty ~ createUser ~ deleteUser ~ getUsers ~ getUsersCurrent - @PUT + @POST @Path("party") @Consumes(value = Array("application/json")) @Operation( @@ -76,7 +76,7 @@ class UserEndpoint(override val storage: ActorRef[Message], override val auth: A def createParty: Route = path("party") { extractExecutionContext { implicit executionContext => - put { + post { entity(as[UserModel]) { user => onSuccess(newPartyId) { partyId => val admin = user.toUser.copy(partyId = partyId, permission = Permission.admin) diff --git a/src/test/scala/me/arcanis/ffxivbis/http/api/v1/UserEndpointTest.scala b/src/test/scala/me/arcanis/ffxivbis/http/api/v1/UserEndpointTest.scala index 8145c99..b00c6e1 100644 --- a/src/test/scala/me/arcanis/ffxivbis/http/api/v1/UserEndpointTest.scala +++ b/src/test/scala/me/arcanis/ffxivbis/http/api/v1/UserEndpointTest.scala @@ -50,7 +50,7 @@ class UserEndpointTest extends AnyWordSpecLike with Matchers with ScalatestRoute val uri = Uri(s"/party") val entity = UserModel.fromUser(Fixtures.userAdmin).copy(password = Fixtures.userPassword) - Put(uri, entity) ~> route ~> check { + Post(uri, entity) ~> route ~> check { status shouldEqual StatusCodes.OK partyId = responseAs[PartyIdModel].partyId }