ZWeb.API.Flat.CoursesController (Portico/Z v0.1.0)

API endpoint for CRUD functions on ZSchemas.Flat.Course data through Z.Flat

Link to this section Summary

Functions

POST /api/flat/courses

DELETE /api/flat/courses/:portico_course_id

GET /api/flat/courses

Link to this section Functions

Link to this function

create(conn, map)

POST /api/flat/courses

Create/update courses.

Expects an courses key, containing a JSON array where each element is a structure corresponding to ZSchemas.Flat.Course.

Will update in the case that a portico_course_id is sent, matching an existing Course. Otherwise, will create a new course.

Link to this function

delete(conn, map)

DELETE /api/flat/courses/:portico_course_id

Destroy a course, by portico_course_id

Link to this function

index(conn, params)

GET /api/flat/courses

List courses

Parameters

You may pass a list of active_session_ids (as strings) - in this case the search will do a "union" match to return any courses that have active sessions that match.

Otherwise, all parameters will be passed directly to Z.Repo.get_all_by/3