Skip to content

Commit

Permalink
fix: cast content/query to string
Browse files Browse the repository at this point in the history
  • Loading branch information
mmkal committed Sep 23, 2020
1 parent d827ed4 commit bf55690
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/demo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const getApp = () => {
app.post('/api/messages', (req, res) =>
slonik
.connect(async conn => {
const content = req.query.content
const content = req.query.content as string
const id = await conn.oneFirst(sql.MessageId`
insert into messages(content)
values (${content})
Expand All @@ -27,7 +27,7 @@ export const getApp = () => {
app.get('/api/messages', (req, res) =>
slonik
.connect(async conn => {
let {before} = req.query
let before = req.query.before as string
const messages = await conn.any(sql.Message`
select * from messages
where id < ${before || 9999999}
Expand Down

0 comments on commit bf55690

Please sign in to comment.