Skip to content

Commit 842c80e

Browse files
committed
Change complex route to allow syntax
1 parent 05bed3a commit 842c80e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/client/assets/templates/complex_route.rd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ route "/api/resource/{id}" GET {
22
val resourceId = request.get_params("id");
33
val resource = Database.get(resourceId);
44

5-
if (resource != null) {
5+
if (resource == "") {
6+
// Resource not found
7+
response.body("Resource not found");
8+
} else {
69
// Resource found
710
response.body(resource);
8-
} else {
9-
// Resource not found
10-
response.status(404).body("Resource not found");
1111
}
1212

1313
response.send();

0 commit comments

Comments
 (0)