Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
polamoros committed Apr 15, 2024
1 parent ffc7339 commit b884ef3
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions apps/wing-console/console/app/demo/main.w
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,17 @@ class ApiUsersService {
let name = request.query.tryGet("name") ?? "";

if name != "" {
return cloud.ApiResponse {
status: 200,
body: this.db.get("user-{name}")
};
try {
return cloud.ApiResponse {
status: 200,
body: this.db.get("user-{name}")
};
} catch {
return cloud.ApiResponse {
status: 404,
body: "User not found"
};
}
}

return cloud.ApiResponse {
Expand Down

0 comments on commit b884ef3

Please sign in to comment.