Skip to main content

upsert_from_snapshot

Function upsert_from_snapshot 

Source
pub async fn upsert_from_snapshot(
    conn: &mut PgConnection,
    snapshot: &ModuleSnapshot,
    actor_user_id: Uuid,
) -> ModelResult<()>
Expand description

Writes every field of the snapshot to the module, creating it with the snapshot’s id if it does not exist and bringing it back if it is deleted. Does not record history.

Errors with InvalidRequest if the completion registration link fails validate_completion_registration_link. Switching the module’s Sisu registration off cancels its registrations not yet sent, on behalf of actor_user_id.