update script policy

This commit is contained in:
Quaternions 2024-12-21 22:13:56 -08:00
parent a22cf15697
commit 6ff44db189

View File

@ -60,6 +60,7 @@ enum ReviewError{
ReadCurrent(std::io::Error), ReadCurrent(std::io::Error),
DeduplicateModified(submissions_api::types::SingleItemError), DeduplicateModified(submissions_api::types::SingleItemError),
UploadModified(submissions_api::Error), UploadModified(submissions_api::Error),
UpdateScriptPolicy(submissions_api::Error),
} }
struct ReviewConfig{ struct ReviewConfig{
@ -145,6 +146,12 @@ async fn review(config:ReviewConfig)->Result<(),ReviewError>{
}; };
// update policy // update policy
api.update_script_policy(submissions_api::types::UpdateScriptPolicyRequest{
ScriptPolicyID:unreviewed_policy.ID,
FromScriptID:None,
ToScriptID:to_script_id,
Policy:Some(reviewed_policy),
}).await.map_err(ReviewError::UpdateScriptPolicy)?;
} }
Ok(()) Ok(())