Fix naming of some path parameters
This commit is contained in:
parent
45a706e0d7
commit
5e44d53216
@ -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());
|
||||||
|
@ -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.");
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user