Skip to content

Commit

Permalink
Bump Chel version
Browse files Browse the repository at this point in the history
  • Loading branch information
corrideat committed Jan 18, 2025
1 parent fa8e3e3 commit 942d1cb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions backend/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ sbp('sbp/selectors/register', {
await sbp('chelonia/db/set', namespaceKey(name), value)
return { name, value }
},
'backend/db/lookupName': async function (name: string): Promise<string | Error> {
'backend/db/lookupName': async function (name: string): Promise<string> {
const value = await sbp('chelonia/db/get', namespaceKey(name))
return value || Boom.notFound()
return value
}
})

Expand Down
5 changes: 4 additions & 1 deletion backend/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,11 @@ route.GET('/name/{name}', {}, async function (request, h) {
const { name } = request.params
try {
const lookupResult = await sbp('backend/db/lookupName', name)
return h.response(lookupResult).type('text/plain')
return lookupResult
? h.response(lookupResult).type('text/plain')
: Boom.notFound()
} catch (err) {
console.error(err, '@@@@@err')
logger.error(err, `GET /name/${name}`, err.message)
return err
}
Expand Down
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"@babel/preset-flow": "7.12.1",
"@babel/register": "7.23.7",
"@babel/runtime": "7.23.8",
"@chelonia/cli": "2.2.3",
"@chelonia/cli": "3.0.0",
"@exact-realty/multipart-parser": "1.0.12",
"@apeleghq/rfc8188": "1.0.7",
"@hapi/boom": "9.1.0",
Expand Down

0 comments on commit 942d1cb

Please sign in to comment.