Fix naming of some path parameters

This commit is contained in:
Colin McDonald 2016-07-10 15:48:51 -04:00
parent 45a706e0d7
commit 5e44d53216
4 changed files with 5 additions and 5 deletions

View File

@ -335,7 +335,7 @@ public final class APIv3 extends AbstractVerticle {
http.post("/punishments").blockingHandler(new POSTPunishments(), false); http.post("/punishments").blockingHandler(new POSTPunishments(), false);
//http.put("/punishments/:punishmentId").blockingHandler(new PUTPunishmentsId(), false); //http.put("/punishments/:punishmentId").blockingHandler(new PUTPunishmentsId(), false);
http.delete("/punishments/:punishmentId").blockingHandler(new DELETEPunishmentsId(), false); http.delete("/punishments/:punishmentId").blockingHandler(new DELETEPunishmentsId(), false);
http.delete("/users/:id/activePunishment").blockingHandler(new DELETEUsersIdActivePunishment(), false); http.delete("/users/:userId/activePunishment").blockingHandler(new DELETEUsersIdActivePunishment(), false);
http.get("/ranks/:rankId").handler(new GETRanksId()); http.get("/ranks/:rankId").handler(new GETRanksId());
http.get("/ranks").handler(new GETRanks()); http.get("/ranks").handler(new GETRanks());

View File

@ -19,7 +19,7 @@ public final class DELETEIpBansId implements Handler<RoutingContext> {
IpBan ipBan = SyncUtils.runBlocking(v -> IpBan.findById(ctx.request().getParam("ipBanId"), v)); IpBan ipBan = SyncUtils.runBlocking(v -> IpBan.findById(ctx.request().getParam("ipBanId"), v));
if (ipBan == null) { if (ipBan == null) {
ErrorUtils.respondNotFound(ctx, "IpBan", ctx.request().getParam("id")); ErrorUtils.respondNotFound(ctx, "IpBan", ctx.request().getParam("ipBanId"));
return; return;
} else if (!ipBan.isActive()) { } else if (!ipBan.isActive()) {
ErrorUtils.respondInvalidInput(ctx, "Cannot remove an inactive ip ban."); ErrorUtils.respondInvalidInput(ctx, "Cannot remove an inactive ip ban.");

View File

@ -19,10 +19,10 @@ import java.util.List;
public final class DELETEUsersIdActivePunishment implements Handler<RoutingContext> { public final class DELETEUsersIdActivePunishment implements Handler<RoutingContext> {
public void handle(RoutingContext ctx) { public void handle(RoutingContext ctx) {
User target = SyncUtils.runBlocking(v -> User.findById(ctx.request().getParam("id"), v)); User target = SyncUtils.runBlocking(v -> User.findById(ctx.request().getParam("userId"), v));
if (target == null) { if (target == null) {
ErrorUtils.respondNotFound(ctx, "User", ctx.request().getParam("id")); ErrorUtils.respondNotFound(ctx, "User", ctx.request().getParam("userId"));
return; return;
} }

View File

@ -20,7 +20,7 @@ public final class POSTUsersIdConfirmPhone implements Handler<RoutingContext> {
User user = SyncUtils.runBlocking(v -> User.findById(ctx.request().getParam("userId"), v)); User user = SyncUtils.runBlocking(v -> User.findById(ctx.request().getParam("userId"), v));
if (user == null) { if (user == null) {
ErrorUtils.respondNotFound(ctx, "User", ctx.request().getParam("id")); ErrorUtils.respondNotFound(ctx, "User", ctx.request().getParam("userId"));
return; return;
} }