Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
revs
Browse files Browse the repository at this point in the history
  • Loading branch information
thesuzerain committed Oct 13, 2023
1 parent a8e50a1 commit ee81e7a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/routes/v2/projects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ pub async fn project_edit(
redis: web::Data<RedisPool>,
session_queue: web::Data<AuthQueue>,
) -> Result<HttpResponse, ApiError> {
println!("project_edit");
let user = get_user_from_headers(
&req,
&**pool,
Expand All @@ -398,7 +397,6 @@ pub async fn project_edit(
)
.await?
.1;
println!("project_edit user: {:?}", serde_json::to_string(&user));

new_project
.validate()
Expand All @@ -407,7 +405,6 @@ pub async fn project_edit(
let string = info.into_inner().0;
let result = db_models::Project::get(&string, &**pool, &redis).await?;

println!("project_edit result: {:?}", serde_json::to_string(&result));
if let Some(project_item) = result {
let id = project_item.inner.id;

Expand All @@ -419,20 +416,12 @@ pub async fn project_edit(
)
.await?;

println!("Team member: {:?}", serde_json::to_string(&team_member));
println!(
"Organization team member: {:?}",
serde_json::to_string(&organization_team_member)
);

let permissions = ProjectPermissions::get_permissions_by_role(
&user.role,
&team_member,
&organization_team_member,
);

println!("Permissions: {:?}", serde_json::to_string(&permissions));

if let Some(perms) = permissions {
let mut transaction = pool.begin().await?;

Expand Down
8 changes: 8 additions & 0 deletions tests/common/dummy_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ use super::{
request_data::get_public_project_creation_data,
};

pub const DUMMY_DATA_UPDATE: i64 = 1;

#[allow(dead_code)]
pub const DUMMY_CATEGORIES: &[&str] = &[
"combat",
Expand Down Expand Up @@ -86,6 +88,12 @@ pub async fn add_dummy_data(test_env: &TestEnvironment) -> DummyData {

let zeta_organization = add_organization_zeta(test_env).await;

sqlx::query("INSERT INTO dummy_data (version) VALUES ($1)")
.bind(DUMMY_DATA_UPDATE)
.execute(pool)
.await
.unwrap();

DummyData {
alpha_team_id: alpha_project.team.to_string(),
beta_team_id: beta_project.team.to_string(),
Expand Down

0 comments on commit ee81e7a

Please sign in to comment.