Skip to content

Commit

Permalink
fix(bookings): don't return rejected or deleted recurring master book…
Browse files Browse the repository at this point in the history
…ings
  • Loading branch information
stakach committed Oct 30, 2024
1 parent 0c9145b commit 4563400
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion shard.lock
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ shards:

raven:
git: https://github.com/sija/raven.cr.git
version: 1.9.4+git.commit.4c3e13760f830a2cc5ab80b24eb02bd9342e5411
version: 1.9.4+git.commit.59020d2838c19e769d7fb5e0ee3a242cd9fdb055

redis:
git: https://github.com/stefanwille/crystal-redis.git
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/bookings.cr
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class Bookings < Application
raise AC::Route::Param::MissingError.new("missing required parameter", "booking_type", "String") unless booking_type.presence

query = query.where(
%{(((recurrence_end > ? OR recurrence_end IS NULL) AND recurrence_type <> 'NONE' AND "booking_start" < ?) OR ("booking_start" < ? AND "booking_end" > ?))},
%{(((recurrence_end > ? OR recurrence_end IS NULL) AND recurrence_type <> 'NONE' AND "booking_start" < ? AND rejected_at IS NULL AND deleted_at IS NULL) OR ("booking_start" < ? AND "booking_end" > ?))},
starting, ending, ending, starting
)

Expand Down

0 comments on commit 4563400

Please sign in to comment.