OrganizationParam returns the organization from the ExtractOrganizationParam handler.
(r *http.Request)
| 24 | |
| 25 | // OrganizationParam returns the organization from the ExtractOrganizationParam handler. |
| 26 | func OrganizationParam(r *http.Request) database.Organization { |
| 27 | organization, ok := r.Context().Value(organizationParamContextKey{}).(database.Organization) |
| 28 | if !ok { |
| 29 | panic("developer error: organization param middleware not provided") |
| 30 | } |
| 31 | return organization |
| 32 | } |
| 33 | |
| 34 | // OrganizationMemberParam returns the organization membership that allowed the query |
| 35 | // from the ExtractOrganizationParam handler. |