Skip to content

Commit

Permalink
change PUT to POST for party creation request
Browse files Browse the repository at this point in the history
  • Loading branch information
arcan1s committed Jan 21, 2022
1 parent d4553b2 commit d301899
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
password: passwordInput.val(),
permission: "admin",
}),
type: "PUT",
type: "POST",
contentType: "application/json",
dataType: "json",
success: function (data) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/me/arcanis/ffxivbis/http/Swagger.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit d301899

Please sign in to comment.