Skip to content

Commit

Permalink
fix: remove unused data extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
sargon64 committed Jul 27, 2023
1 parent dca0aea commit be7e9e3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 53 deletions.
45 changes: 0 additions & 45 deletions migration/src/m20230727_015400_load_default_data.rs
Original file line number Diff line number Diff line change
@@ -1,51 +1,6 @@
use sea_orm_migration::{prelude::*, sea_orm::{Set, TransactionTrait, ActiveModelTrait, EntityTrait, ColumnTrait, QueryFilter}};
use entity::{prelude::*, beat_saber_versions, categories};

//INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.31.0');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.30.2');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.30.0');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.29.4');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.26.0');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.29.0');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.28.0');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.27.0');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.26.2');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.26.1');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.21.0');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.20.0');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.19.0');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.18.0');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.17.0');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.16.3');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.16.1');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.13.4');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.13.2');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.12.2');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.11.0');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.8.0');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.6.1');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.6.0');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.5.0');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.3.0');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.1.1');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.1.0');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '1.0.0');
// INSERT INTO beat_saber_versions VALUES (DEFAULT, '0.13.2');

//INSERT INTO categories VALUES (DEFAULT, 'core', 'Mods that only depend on other core mods.');
// INSERT INTO categories VALUES (DEFAULT, 'libraries', 'Mods that are used by other mods.');
// INSERT INTO categories VALUES (DEFAULT, 'cosmetic', 'Mods that affect the appearance of the game.');
// INSERT INTO categories VALUES (DEFAULT, 'gameplay', 'Mods that affect gameplay.');
// INSERT INTO categories VALUES (DEFAULT, 'leaderboards', 'Mods that affect leaderboards.');
// INSERT INTO categories VALUES (DEFAULT, 'lighting', 'Mods that affect lighting.');
// INSERT INTO categories VALUES (DEFAULT, 'multiplayer', 'Mods that change online play.');
// INSERT INTO categories VALUES (DEFAULT, 'accessibility', 'Mods that affect accessibility.');
// INSERT INTO categories VALUES (DEFAULT, 'practice', 'Mods that are used for practice.');
// INSERT INTO categories VALUES (DEFAULT, 'streaming', 'Mods that affect live streams.');
// INSERT INTO categories VALUES (DEFAULT, 'text', 'Mods that change how text is displayed.');
// INSERT INTO categories VALUES (DEFAULT, 'tweaks', 'Mods that tweak the gameplay experience.');
// INSERT INTO categories VALUES (DEFAULT, 'ui', 'Mods that affect the ui.');
// INSERT INTO categories VALUES (DEFAULT, 'other', 'Mods that do not fit into other categories.');
const BEAT_SABER_VERSIONS: [&'static str; 30] = [
"1.31.0",
"1.30.2",
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ async fn main() -> io::Result<()> {
HttpServer::new( move || {
App::new()
.app_data(Data::new(create_schema()))
.app_data(Data::new(KEY.clone()))
.app_data(Data::new(Database {
pool: db_conn.clone(),
}))
Expand Down
7 changes: 4 additions & 3 deletions src/mods.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use actix_web::{web, Responder, HttpRequest, post, HttpResponse};
use chrono::{DateTime, Utc};
use forge_lib::structs::forgemod::ForgeMod;

Check warning on line 3 in src/mods.rs

View workflow job for this annotation

GitHub Actions / beatforge_api

unused import: `forge_lib::structs::forgemod::ForgeMod`

Check warning on line 3 in src/mods.rs

View workflow job for this annotation

GitHub Actions / beatforge_api

unused import: `forge_lib::structs::forgemod::ForgeMod`
use juniper::{FieldError, FieldResult, GraphQLObject};
Expand Down Expand Up @@ -108,7 +109,7 @@ pub async fn find_by_author(db: &Database, author: Uuid) -> FieldResult<Vec<Mod>
Ok(futures::future::join_all(mods).await)
}

pub async fn new_mod(db: &Database, forgemod: ForgeMod) -> FieldResult<Mod> {

todo!()
#[post("/mods")]
pub async fn create_mod(db: web::Data<Database>, payload: web::Payload, req: HttpRequest) -> impl Responder {
HttpResponse::Ok().body("Hello world!")
}
7 changes: 3 additions & 4 deletions src/users.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use uuid::Uuid;
use crate::{
auth::{self, validate_permissions, Authorization, JWTAuth, Permission},

Check warning on line 13 in src/users.rs

View workflow job for this annotation

GitHub Actions / beatforge_api

unused imports: `Key`, `self`

Check warning on line 13 in src/users.rs

View workflow job for this annotation

GitHub Actions / beatforge_api

unused imports: `Key`, `self`
mods::{self, Mod},
Database, Key,
Database, Key, KEY,
};

#[derive(GraphQLObject, Debug, Deserialize, Serialize)]
Expand Down Expand Up @@ -152,7 +152,6 @@ pub struct UserAuthReq {
pub async fn user_auth(
req: HttpRequest,
data: web::Data<Database>,
key: web::Data<Key>,
info: web::Query<UserAuthReq>,
) -> impl Responder {
let code = &info.code;
Expand All @@ -166,7 +165,7 @@ pub async fn user_auth(
}))
.unwrap()
.send()
.unwrap(); //.json::<Value>().unwrap()["access_token"].to_string();
.unwrap();
let gat = gat.as_str().unwrap().split("&").collect::<Vec<_>>()[0]
.split("=")
.collect::<Vec<_>>()[1]
Expand Down Expand Up @@ -207,7 +206,7 @@ pub async fn user_auth(
.unwrap()
.unwrap();

let jwt = JWTAuth::new(user).encode(**key);
let jwt = JWTAuth::new(user).encode(*KEY.clone());

let mut res = HttpResponse::Ok();
res.cookie(
Expand Down

0 comments on commit be7e9e3

Please sign in to comment.