Skip to content

Commit

Permalink
fix: query should filter out soft deleted events (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaniswara authored Mar 18, 2024
1 parent 6bb31ae commit e9e8c2f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/(server)/_features/event/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ export class EventRepo implements iEventRepo {
}

const filter = sql`
${events.createdBy} = ${userID} AND(
(${events.status} = ${'published'} AND ${events.endTime} >= NOW())
${events.createdBy} = ${userID} AND
${events.deletedAt} IS NULL AND
((${events.status} = ${'published'} AND ${events.endTime} >= NOW())
OR ${events.status} = ${'cancelled'}
OR ${events.status} = ${'draft'})`;

Expand Down

0 comments on commit e9e8c2f

Please sign in to comment.