validation: tweak validator-uploaded endpoint

This commit is contained in:
Quaternions 2025-03-31 15:45:06 -07:00
parent a60ccd22f0
commit ffcba57408
Signed by: Quaternions
GPG Key ID: D0DF5964F79AC131
4 changed files with 9 additions and 5 deletions

@ -151,9 +151,9 @@ impl Context{
let url_raw=format!("{}/submissions/{}/status/validator-uploaded",self.0.base_url,config.SubmissionID);
let mut url=reqwest::Url::parse(url_raw.as_str()).map_err(Error::Parse)?;
if let Some(target_asset_id)=config.TargetAssetID{
{
url.query_pairs_mut()
.append_pair("TargetAssetID",target_asset_id.to_string().as_str());
.append_pair("UploadedAssetID",config.UploadedAssetID.to_string().as_str());
}
response_ok(
self.0.post_empty_body(url).await.map_err(Error::Reqwest)?

@ -177,7 +177,7 @@ pub struct UpdateSubmissionModelRequest{
#[derive(Clone,Debug)]
pub struct ActionSubmissionUploadedRequest{
pub SubmissionID:i64,
pub TargetAssetID:Option<u64>,
pub UploadedAssetID:u64,
}
#[allow(nonstandard_style)]

@ -7,6 +7,7 @@ pub enum UploadError{
Json(serde_json::Error),
Upload(rbx_asset::cookie::UploadError),
ApiActionSubmissionUploaded(submissions_api::Error),
Unimplemented,
}
impl std::fmt::Display for UploadError{
fn fmt(&self,f:&mut std::fmt::Formatter<'_>)->std::fmt::Result{
@ -51,10 +52,13 @@ impl Uploader{
// that's it, the database entry does not need to be changed.
//TEMP
return Err(UploadError::Unimplemented);
// mark submission as uploaded, TargetAssetID is unchanged
self.api_internal.action_submission_uploaded(submissions_api::types::ActionSubmissionUploadedRequest{
SubmissionID:upload_info.SubmissionID,
TargetAssetID:None,
UploadedAssetID:0, //TEMP
}).await.map_err(UploadError::ApiActionSubmissionUploaded)?;
Ok(())

@ -52,7 +52,7 @@ impl Uploader{
// note the asset id of the created model for later release, and mark the submission as uploaded
self.api.action_submission_uploaded(submissions_api::types::ActionSubmissionUploadedRequest{
SubmissionID:upload_info.SubmissionID,
TargetAssetID:Some(upload_response.AssetId),
UploadedAssetID:upload_response.AssetId,
}).await.map_err(UploadError::ApiActionSubmissionUploaded)?;
Ok(())