EventFeedbackController
struct EventFeedbackController : APIRouteCollection
The collection of /api/v3/feedback/*
route endpoints and handler functions related
to shadow event feedback surveys. These surveys are for the organizers of shadow events to report
back to THO how their event went.
-
Required. Registers routes to the incoming router.
Declaration
Swift
func registerRoutes(_ app: Application) throws
-
getEventList(_:
Asynchronous) GET /api/v3/feedback/eventlist
Returns EventData for events upon which the user could submit feedback.
URL Query Parameters:
room=STRING If present, fills in the
matchingRoom
member of the returned struct with events with STRING as prefix for their room name
Declaration
Swift
func getEventList(_ req: Request) async throws -> EventFeedbackSelectionData
Return Value
-
getFeedbackFromID(_:
Asynchronous) GET /api/v3/feedback/id/:event_id
Gets any existing feedback the current user has posted for for the given event. Here, the event ID is the Twitarr database ID for the event.
Declaration
Swift
func getFeedbackFromID(_ req: Request) async throws -> EventFeedbackReport
-
getFeedbackFromUID(_:
Asynchronous) GET /api/v3/feedback/uid/:event_uid
Gets any existing feedback the current user has posted for for the given event.
Event_UID
comes from Sched’s .ics output, is unique per event, and follows the event as it gets passed around (unlike the ID, which is specific to our databse). This could be used to mass-email hosts before sailing, giving them a link to their event’s feedback form.Declaration
Swift
func getFeedbackFromUID(_ req: Request) async throws -> EventFeedbackReport
-
createFeedback(_:
Asynchronous) POST /api/v3/feedback
Saves or updates host feedback about a shadow event. Currently, the feedback must reference an event on the public schedule. The feedback is tied to the current user and uniqued per user/event pair.
Declaration
Swift
func createFeedback(_ req: Request) async throws -> HTTPStatus
Parameters
EventFeedbackData
JSON in request body
Return Value
200 OK if feedback was saved/updated.
-
getRoomList(_:
Asynchronous) GET /api/v3/admin/feedback/roomlist
Returns a list of all room names that are listed as the location of a Shadow or Workshop event on the official schedule.
Declaration
Swift
func getRoomList(_ req: Request) async throws -> [String]
-
getFeedbackReports(_:
Asynchronous) GET /api/v3/admin/feedback/reports
Returns all feedback reports that have been filed, sorted by descending update time. This usually means ‘most recent first’, but editing an existing report bumps it to the top.
Declaration
Swift
func getFeedbackReports(_ req: Request) async throws -> [EventFeedbackReport]
-
getFeedbackReport(_:
Asynchronous) GET /api/v3/admin/feedback/report/:report_id
Returns all feedback reports that have been filed, sorted by descending update time. This usually means ‘most recent first’, but editing an existing report bumps it to the top.
Declaration
Swift
func getFeedbackReport(_ req: Request) async throws -> EventFeedbackReport
-
getFeedbackStats(_:
Asynchronous) GET /api/v3/admin/feedback/stats
Returns statistics on shadow events and shadow event feedback reports.
Declaration
Swift
func getFeedbackStats(_ req: Request) async throws -> EventFeedbackStats
-
markFeedbackActionable(_:
Asynchronous) POST /api/v3/admin/feedback/report/:report_id/mark
Mark the given report as containing something actionable. Actionable is a global flag attached to the report. Intended use case is that the reports manager can set this on reports that have actionable issues that need to be dealt with during the cruise, and clear it when the issue is resolved.
Declaration
Swift
func markFeedbackActionable(_ req: Request) async throws -> HTTPStatus
Parameters
report_id
in URL path
Return Value
201 Created on success; 200 OK if already marked.
-
removeFeedbackActionable(_:
Asynchronous) POST /api/v3/admin/feedback/report/:report_id/unmark
Clears ‘actionable’ status on a feedback report. Actionable is a global flag attached to the report. Intended use case is that the reports manager can set this on reports that have actionable issues that need to be dealt with during the cruise, and clear it when the issue is resolved.
Throws
400 error if the event was not favorited.Declaration
Swift
func removeFeedbackActionable(_ req: Request) async throws -> HTTPStatus
Parameters
report_id
in URL path
Return Value
204 No Content on success; 200 OK if event is already not marked.