Skip to content

Commit eb22a2f

Browse files
fix: update sample authenticated-json-api (#943)
Signed-off-by: Alex Ivanov <[email protected]>
1 parent 146075c commit eb22a2f

File tree

1 file changed

+1
-1
lines changed
  • authenticated-json-api/functions

1 file changed

+1
-1
lines changed

authenticated-json-api/functions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ app.post('/api/messages', async (req, res) => {
9292
app.get('/api/messages', async (req, res) => {
9393
// @ts-ignore
9494
const uid = req.user.uid;
95-
const category = `${req.query.category}`;
95+
const category = `${req.query?.category ?? ''}`;
9696

9797
/** @type admin.database.Query */
9898
let query = admin.database().ref(`/users/${uid}/messages`);

0 commit comments

Comments
 (0)