feat: materials by zjazd in the student API and admin

The material admin form gets the "Na zjazd" picker, every student
material JSON carries meeting_id, and GET /materials accepts meeting=
inside the published-only scope, so the Pulpit hero can list the
zjazd's materials next to its readings.
This commit is contained in:
Jakub Zych
2026-10-27 01:44:38 +01:00
parent 3241cc9894
commit ff2f97eb2b
9 changed files with 58 additions and 16 deletions

View File

@@ -148,6 +148,7 @@ func TestQueryValidation(t *testing.T) {
{"materials page zero", h.Materials, "/?page=0", "page"},
{"materials per_page too large", h.Materials, "/?per_page=1000", "per_page"},
{"materials course negative", h.Materials, "/?course=-1", "course"},
{"materials meeting zero", h.Materials, "/?meeting=0", "meeting"},
{"materials tag too long", h.Materials, "/?tag=" + longTag(), "tag"},
}
for _, tc := range cases {
@@ -188,6 +189,7 @@ func TestValidQueriesReachTheDatabase(t *testing.T) {
{h.Readings, "/?course=3"},
{h.Courses, "/?semester=2"},
{h.Materials, "/?course=1&tag=geopolityka&type=pdf&page=2&per_page=10"},
{h.Materials, "/?meeting=4&per_page=100"},
} {
if code, body := serve(t, tc.fn, http.MethodGet, tc.target, user, nil); code != http.StatusServiceUnavailable {
t.Errorf("%s = %d %v, want to pass validation (503 without a database)", tc.target, code, body)