Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions OPENAPI_DOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6268,6 +6268,13 @@ paths:
required: true
schema:
type: string
- name: ical_uid
in: query
description: the ical uid of the event you are looking for
example: sqvitruh3ho3mrq896tplad4v8
schema:
type: string
nullable: true
responses:
200:
description: OK
Expand Down
22 changes: 15 additions & 7 deletions src/controllers/events.cr
Original file line number Diff line number Diff line change
Expand Up @@ -1706,16 +1706,24 @@ class Events < Application
event_id : String,
@[AC::Param::Info(description: "the event space associated with this event", example: "sys-1234")]
system_id : String,
@[AC::Param::Info(description: "the ical uid of the event you are looking for", example: "sqvitruh3ho3mrq896tplad4v8")]
ical_uid : String? = nil,
) : Array(Guest)
cal_id = get_placeos_client.systems.fetch(system_id).email
return [] of Guest unless cal_id
if ical_uid.presence
metadata = EventMetadata.by_tenant(tenant.id).where(ical_uid: ical_uid, system_id: system_id).first?
parent_meta = false
else
cal_id = get_placeos_client.systems.fetch(system_id).email
return [] of Guest unless cal_id

event = client.get_event(user.email, id: event_id, calendar_id: cal_id)
raise Error::NotFound.new("event #{event_id} not found on system calendar #{cal_id}") unless event
event = client.get_event(user.email, id: event_id, calendar_id: cal_id)
raise Error::NotFound.new("event #{event_id} not found on system calendar #{cal_id}") unless event

# Grab meeting metadata if it exists
metadata = get_event_metadata(event, system_id)
parent_meta = !metadata.try &.for_event_instance?(event, client.client_id)
end

# Grab meeting metadata if it exists
metadata = get_event_metadata(event, system_id)
parent_meta = !metadata.try &.for_event_instance?(event, client.client_id)
return [] of Guest unless metadata

# Find anyone who is attending
Expand Down
Loading