Skip to content

Commit

Permalink
fix age
Browse files Browse the repository at this point in the history
  • Loading branch information
9il committed Apr 25, 2015
1 parent f33a94d commit f5737dc
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions examples/vibed-mongo/source/service.d
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class MongoService
string username,
string email,
string fullname,
int age,
uint age,
string location,
string gender,
HTTPServerResponse res,
Expand All @@ -33,7 +33,7 @@ class MongoService
import vibe.utils.validation;

logInfo(text("MongoService: POST /adduser : ", username));
enforce(age < 200 && age >= 0, "wrong age");
enforce(age < 200, "wrong age");

auto bson = Bson.emptyObject;
bson.username = validateUserName(username);
Expand All @@ -55,10 +55,7 @@ class MongoService

@path("deleteuser/:id")
@method(HTTPMethod.DELETE)
void pullOutUser(
BsonObjectID _id,
HTTPServerResponse res,
)
void pullOutUser(BsonObjectID _id, HTTPServerResponse res)
{
logInfo(text("MongoService: GET /deleteuser/", _id));
collection.remove(["_id": _id]);
Expand Down

0 comments on commit f5737dc

Please sign in to comment.