Payouts finish (#470)

* Almost done

* More work on midas

* Finish payouts backend

* Update Cargo.lock

* Run fmt + prepare
This commit is contained in:
Geometrically
2022-10-30 23:34:56 -07:00
committed by GitHub
parent 6e72be54cb
commit 2ca6e67b37
31 changed files with 2267 additions and 1050 deletions

View File

@@ -136,9 +136,7 @@ pub async fn mod_create(
let undo_result = undo_uploads(&***file_host, &uploaded_files).await;
let rollback_result = transaction.rollback().await;
if let Err(e) = undo_result {
return Err(e);
}
undo_result?;
if let Err(e) = rollback_result {
return Err(e.into());
}

View File

@@ -1,4 +1,4 @@
use crate::file_hosting::FileHost;
use crate::database;
use crate::models::ids::{ProjectId, UserId, VersionId};
use crate::models::projects::{
Dependency, GameVersion, Loader, Version, VersionFile, VersionType,
@@ -7,12 +7,10 @@ use crate::models::teams::Permissions;
use crate::routes::versions::{VersionIds, VersionListFilters};
use crate::routes::ApiError;
use crate::util::auth::get_user_from_headers;
use crate::{database, models};
use actix_web::{delete, get, web, HttpRequest, HttpResponse};
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use sqlx::PgPool;
use std::sync::Arc;
/// A specific version of a mod
#[derive(Serialize, Deserialize)]
@@ -286,7 +284,6 @@ pub async fn delete_file(
req: HttpRequest,
info: web::Path<(String,)>,
pool: web::Data<PgPool>,
file_host: web::Data<Arc<dyn FileHost + Send + Sync>>,
algorithm: web::Query<Algorithm>,
) -> Result<HttpResponse, ApiError> {
let user = get_user_from_headers(req.headers(), &**pool).await?;