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/eventlistReturns EventData for events upon which the user could submit feedback.
URL Query Parameters:
room=STRING If present, fills in the
matchingRoommember of the returned struct with events with STRING as prefix for their room name
Declaration
Swift
func getEventList(_ req: Request) async throws -> EventFeedbackSelectionDataReturn Value
-
getFeedbackFromID(_:Asynchronous) GET /api/v3/feedback/id/:event_idGets 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_uidGets any existing feedback the current user has posted for for the given event.
Event_UIDcomes 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/feedbackSaves 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 -> HTTPStatusParameters
EventFeedbackDataJSON in request body
Return Value
200 OK if feedback was saved/updated.
-
getRoomList(_:Asynchronous) GET /api/v3/admin/feedback/roomlistReturns 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/reportsReturns 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_idReturns 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/statsReturns 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/markMark 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 -> HTTPStatusParameters
report_idin URL path
Return Value
201 Created on success; 200 OK if already marked.
-
removeFeedbackActionable(_:Asynchronous) POST /api/v3/admin/feedback/report/:report_id/unmarkClears ‘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 -> HTTPStatusParameters
report_idin URL path
Return Value
204 No Content on success; 200 OK if event is already not marked.
View on GitHub