Skip to content

Commit

Permalink
filter tags
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmeirlevy committed May 22, 2024
1 parent 9cc00d6 commit 95edf82
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ createCrud<EventDoc>({
return data;
},
readMany: async (query, { tenantPayload }) => {
console.log(tenantPayload)
const dbQuery: any = { tenant: tenantPayload.sub };
if (query.tags) {
dbQuery.tags = query.tags
}
return events.find({ tenant: tenantPayload.sub }).toArray()
},
updateOne: async (_id, body: EventDoc, { user, tenantPayload }) => {
Expand Down

0 comments on commit 95edf82

Please sign in to comment.