Skip to main content

insert_enrollment_if_it_doesnt_exist

Function insert_enrollment_if_it_doesnt_exist 

Source
pub async fn insert_enrollment_if_it_doesnt_exist(
    conn: &mut PgConnection,
    enrollment: NewCourseInstanceEnrollment,
) -> ModelResult<CourseInstanceEnrollment>
Expand description

Inserts enrollment if it doesn’t exist yet, or restores a soft-deleted one.

Safe to call concurrently for the same enrollment, e.g. from multiple tabs or parallel requests.