feat: ability to create a project #9

Merged
matous-volf merged 50 commits from feat/project-create into main 2024-08-18 21:36:06 +00:00
Showing only changes of commit 85bcbad41c - Show all commits

View File

@ -22,17 +22,18 @@ pub(crate) async fn create_project(
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Ensure proper error handling for database connections.

The establish_database_connection function call should handle potential errors instead of assuming a successful connection. Consider using Result to propagate errors.

let connection = establish_database_connection().map_err(|e| {
    eprintln!("Failed to connect to the database: {}", e);
    ServerFnError::from(e)
})?;
**Ensure proper error handling for database connections.** The `establish_database_connection` function call should handle potential errors instead of assuming a successful connection. Consider using `Result` to propagate errors. ```rust let connection = establish_database_connection().map_err(|e| { eprintln!("Failed to connect to the database: {}", e); ServerFnError::from(e) })?; ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Ensure proper error handling for database connections.

The establish_database_connection function call should handle potential errors instead of assuming a successful connection. Consider using Result to propagate errors.

let connection = establish_database_connection().map_err(|e| {
    eprintln!("Failed to connect to the database: {}", e);
    ServerFnError::from(e)
})?;
**Ensure proper error handling for database connections.** The `establish_database_connection` function call should handle potential errors instead of assuming a successful connection. Consider using `Result` to propagate errors. ```rust let connection = establish_database_connection().map_err(|e| { eprintln!("Failed to connect to the database: {}", e); ServerFnError::from(e) })?; ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 19:24:13 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 19:24:13 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 20:12:41 +00:00 (Migrated from github.com)
Review

Consider removing the testing function.

The testing function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean.

**Consider removing the `testing` function.** The `testing` function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean. <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 20:12:41 +00:00 (Migrated from github.com)
Review

Consider removing the testing function.

The testing function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean.

**Consider removing the `testing` function.** The `testing` function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean. <!-- This is an auto-generated comment by CodeRabbit -->
.validate() .validate()
.map_err::<ErrorVec<ProjectCreateError>, _>(|errors| errors.into())?; .map_err::<ErrorVec<ProjectCreateError>, _>(|errors| errors.into())?;
let mut connection = let mut connection = establish_database_connection()
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Ensure proper error handling for database connections.

The establish_database_connection function call should handle potential errors instead of assuming a successful connection. Consider using Result to propagate errors.

let connection = establish_database_connection().map_err(|e| {
    eprintln!("Failed to connect to the database: {}", e);
    ServerFnError::from(e)
})?;
**Ensure proper error handling for database connections.** The `establish_database_connection` function call should handle potential errors instead of assuming a successful connection. Consider using `Result` to propagate errors. ```rust let connection = establish_database_connection().map_err(|e| { eprintln!("Failed to connect to the database: {}", e); ServerFnError::from(e) })?; ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 19:24:13 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 20:12:41 +00:00 (Migrated from github.com)
Review

Consider removing the testing function.

The testing function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean.

**Consider removing the `testing` function.** The `testing` function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean. <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Ensure proper error handling for database connections.

The establish_database_connection function call should handle potential errors instead of assuming a successful connection. Consider using Result to propagate errors.

let connection = establish_database_connection().map_err(|e| {
    eprintln!("Failed to connect to the database: {}", e);
    ServerFnError::from(e)
})?;
**Ensure proper error handling for database connections.** The `establish_database_connection` function call should handle potential errors instead of assuming a successful connection. Consider using `Result` to propagate errors. ```rust let connection = establish_database_connection().map_err(|e| { eprintln!("Failed to connect to the database: {}", e); ServerFnError::from(e) })?; ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 19:24:13 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 20:12:41 +00:00 (Migrated from github.com)
Review

Consider removing the testing function.

The testing function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean.

**Consider removing the `testing` function.** The `testing` function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean. <!-- This is an auto-generated comment by CodeRabbit -->
establish_database_connection().or::<ErrorVec<ProjectCreateError>>(Err(vec![ .map_err::<ErrorVec<ProjectCreateError>, _>(
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Ensure proper error handling for database connections.

The establish_database_connection function call should handle potential errors instead of assuming a successful connection. Consider using Result to propagate errors.

let connection = establish_database_connection().map_err(|e| {
    eprintln!("Failed to connect to the database: {}", e);
    ServerFnError::from(e)
})?;
**Ensure proper error handling for database connections.** The `establish_database_connection` function call should handle potential errors instead of assuming a successful connection. Consider using `Result` to propagate errors. ```rust let connection = establish_database_connection().map_err(|e| { eprintln!("Failed to connect to the database: {}", e); ServerFnError::from(e) })?; ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 19:24:13 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 20:12:41 +00:00 (Migrated from github.com)
Review

Consider removing the testing function.

The testing function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean.

**Consider removing the `testing` function.** The `testing` function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean. <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Ensure proper error handling for database connections.

The establish_database_connection function call should handle potential errors instead of assuming a successful connection. Consider using Result to propagate errors.

let connection = establish_database_connection().map_err(|e| {
    eprintln!("Failed to connect to the database: {}", e);
    ServerFnError::from(e)
})?;
**Ensure proper error handling for database connections.** The `establish_database_connection` function call should handle potential errors instead of assuming a successful connection. Consider using `Result` to propagate errors. ```rust let connection = establish_database_connection().map_err(|e| { eprintln!("Failed to connect to the database: {}", e); ServerFnError::from(e) })?; ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 19:24:13 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 20:12:41 +00:00 (Migrated from github.com)
Review

Consider removing the testing function.

The testing function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean.

**Consider removing the `testing` function.** The `testing` function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean. <!-- This is an auto-generated comment by CodeRabbit -->
ProjectCreateError::Error(Error::ServerInternal), |_| vec![ProjectCreateError::Error(Error::ServerInternal), ].into()
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Ensure proper error handling for database connections.

The establish_database_connection function call should handle potential errors instead of assuming a successful connection. Consider using Result to propagate errors.

let connection = establish_database_connection().map_err(|e| {
    eprintln!("Failed to connect to the database: {}", e);
    ServerFnError::from(e)
})?;
**Ensure proper error handling for database connections.** The `establish_database_connection` function call should handle potential errors instead of assuming a successful connection. Consider using `Result` to propagate errors. ```rust let connection = establish_database_connection().map_err(|e| { eprintln!("Failed to connect to the database: {}", e); ServerFnError::from(e) })?; ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 19:24:13 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 20:12:41 +00:00 (Migrated from github.com)
Review

Consider removing the testing function.

The testing function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean.

**Consider removing the `testing` function.** The `testing` function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean. <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Ensure proper error handling for database connections.

The establish_database_connection function call should handle potential errors instead of assuming a successful connection. Consider using Result to propagate errors.

let connection = establish_database_connection().map_err(|e| {
    eprintln!("Failed to connect to the database: {}", e);
    ServerFnError::from(e)
})?;
**Ensure proper error handling for database connections.** The `establish_database_connection` function call should handle potential errors instead of assuming a successful connection. Consider using `Result` to propagate errors. ```rust let connection = establish_database_connection().map_err(|e| { eprintln!("Failed to connect to the database: {}", e); ServerFnError::from(e) })?; ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 19:24:13 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 20:12:41 +00:00 (Migrated from github.com)
Review

Consider removing the testing function.

The testing function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean.

**Consider removing the `testing` function.** The `testing` function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean. <!-- This is an auto-generated comment by CodeRabbit -->
] )?;
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Ensure proper error handling for database connections.

The establish_database_connection function call should handle potential errors instead of assuming a successful connection. Consider using Result to propagate errors.

let connection = establish_database_connection().map_err(|e| {
    eprintln!("Failed to connect to the database: {}", e);
    ServerFnError::from(e)
})?;
**Ensure proper error handling for database connections.** The `establish_database_connection` function call should handle potential errors instead of assuming a successful connection. Consider using `Result` to propagate errors. ```rust let connection = establish_database_connection().map_err(|e| { eprintln!("Failed to connect to the database: {}", e); ServerFnError::from(e) })?; ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 19:24:13 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 20:12:41 +00:00 (Migrated from github.com)
Review

Consider removing the testing function.

The testing function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean.

**Consider removing the `testing` function.** The `testing` function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean. <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Ensure proper error handling for database connections.

The establish_database_connection function call should handle potential errors instead of assuming a successful connection. Consider using Result to propagate errors.

let connection = establish_database_connection().map_err(|e| {
    eprintln!("Failed to connect to the database: {}", e);
    ServerFnError::from(e)
})?;
**Ensure proper error handling for database connections.** The `establish_database_connection` function call should handle potential errors instead of assuming a successful connection. Consider using `Result` to propagate errors. ```rust let connection = establish_database_connection().map_err(|e| { eprintln!("Failed to connect to the database: {}", e); ServerFnError::from(e) })?; ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 19:24:13 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 20:12:41 +00:00 (Migrated from github.com)
Review

Consider removing the testing function.

The testing function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean.

**Consider removing the `testing` function.** The `testing` function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean. <!-- This is an auto-generated comment by CodeRabbit -->
.into()))?;
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Ensure proper error handling for database connections.

The establish_database_connection function call should handle potential errors instead of assuming a successful connection. Consider using Result to propagate errors.

let connection = establish_database_connection().map_err(|e| {
    eprintln!("Failed to connect to the database: {}", e);
    ServerFnError::from(e)
})?;
**Ensure proper error handling for database connections.** The `establish_database_connection` function call should handle potential errors instead of assuming a successful connection. Consider using `Result` to propagate errors. ```rust let connection = establish_database_connection().map_err(|e| { eprintln!("Failed to connect to the database: {}", e); ServerFnError::from(e) })?; ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 19:24:13 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 20:12:41 +00:00 (Migrated from github.com)
Review

Consider removing the testing function.

The testing function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean.

**Consider removing the `testing` function.** The `testing` function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean. <!-- This is an auto-generated comment by CodeRabbit -->
let new_project = diesel::insert_into(projects::table) let new_project = diesel::insert_into(projects::table)
.values(&new_project) .values(&new_project)
.returning(Project::as_returning()) .returning(Project::as_returning())
.get_result(&mut connection) .get_result(&mut connection)
.expect("error saving a new project"); .map_err::<ErrorVec<ProjectCreateError>, _>(
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Ensure proper error handling for database connections.

The establish_database_connection function call should handle potential errors instead of assuming a successful connection. Consider using Result to propagate errors.

let connection = establish_database_connection().map_err(|e| {
    eprintln!("Failed to connect to the database: {}", e);
    ServerFnError::from(e)
})?;
**Ensure proper error handling for database connections.** The `establish_database_connection` function call should handle potential errors instead of assuming a successful connection. Consider using `Result` to propagate errors. ```rust let connection = establish_database_connection().map_err(|e| { eprintln!("Failed to connect to the database: {}", e); ServerFnError::from(e) })?; ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 19:24:13 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 20:12:41 +00:00 (Migrated from github.com)
Review

Consider removing the testing function.

The testing function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean.

**Consider removing the `testing` function.** The `testing` function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean. <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Ensure proper error handling for database connections.

The establish_database_connection function call should handle potential errors instead of assuming a successful connection. Consider using Result to propagate errors.

let connection = establish_database_connection().map_err(|e| {
    eprintln!("Failed to connect to the database: {}", e);
    ServerFnError::from(e)
})?;
**Ensure proper error handling for database connections.** The `establish_database_connection` function call should handle potential errors instead of assuming a successful connection. Consider using `Result` to propagate errors. ```rust let connection = establish_database_connection().map_err(|e| { eprintln!("Failed to connect to the database: {}", e); ServerFnError::from(e) })?; ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 19:24:13 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 20:12:41 +00:00 (Migrated from github.com)
Review

Consider removing the testing function.

The testing function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean.

**Consider removing the `testing` function.** The `testing` function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean. <!-- This is an auto-generated comment by CodeRabbit -->
|_| vec![ProjectCreateError::Error(Error::ServerInternal), ].into()
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Ensure proper error handling for database connections.

The establish_database_connection function call should handle potential errors instead of assuming a successful connection. Consider using Result to propagate errors.

let connection = establish_database_connection().map_err(|e| {
    eprintln!("Failed to connect to the database: {}", e);
    ServerFnError::from(e)
})?;
**Ensure proper error handling for database connections.** The `establish_database_connection` function call should handle potential errors instead of assuming a successful connection. Consider using `Result` to propagate errors. ```rust let connection = establish_database_connection().map_err(|e| { eprintln!("Failed to connect to the database: {}", e); ServerFnError::from(e) })?; ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 19:24:13 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 20:12:41 +00:00 (Migrated from github.com)
Review

Consider removing the testing function.

The testing function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean.

**Consider removing the `testing` function.** The `testing` function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean. <!-- This is an auto-generated comment by CodeRabbit -->
)?;
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Ensure proper error handling for database connections.

The establish_database_connection function call should handle potential errors instead of assuming a successful connection. Consider using Result to propagate errors.

let connection = establish_database_connection().map_err(|e| {
    eprintln!("Failed to connect to the database: {}", e);
    ServerFnError::from(e)
})?;
**Ensure proper error handling for database connections.** The `establish_database_connection` function call should handle potential errors instead of assuming a successful connection. Consider using `Result` to propagate errors. ```rust let connection = establish_database_connection().map_err(|e| { eprintln!("Failed to connect to the database: {}", e); ServerFnError::from(e) })?; ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 19:24:13 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 20:12:41 +00:00 (Migrated from github.com)
Review

Consider removing the testing function.

The testing function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean.

**Consider removing the `testing` function.** The `testing` function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean. <!-- This is an auto-generated comment by CodeRabbit -->
Ok(new_project) Ok(new_project)
} }

coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Ensure proper error handling for database connections.

The establish_database_connection function call should handle potential errors instead of assuming a successful connection. Consider using Result to propagate errors.

let connection = establish_database_connection().map_err(|e| {
    eprintln!("Failed to connect to the database: {}", e);
    ServerFnError::from(e)
})?;
**Ensure proper error handling for database connections.** The `establish_database_connection` function call should handle potential errors instead of assuming a successful connection. Consider using `Result` to propagate errors. ```rust let connection = establish_database_connection().map_err(|e| { eprintln!("Failed to connect to the database: {}", e); ServerFnError::from(e) })?; ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Ensure proper error handling for database connections.

The establish_database_connection function call should handle potential errors instead of assuming a successful connection. Consider using Result to propagate errors.

let connection = establish_database_connection().map_err(|e| {
    eprintln!("Failed to connect to the database: {}", e);
    ServerFnError::from(e)
})?;
**Ensure proper error handling for database connections.** The `establish_database_connection` function call should handle potential errors instead of assuming a successful connection. Consider using `Result` to propagate errors. ```rust let connection = establish_database_connection().map_err(|e| { eprintln!("Failed to connect to the database: {}", e); ServerFnError::from(e) })?; ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-16 22:39:19 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 19:24:13 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 19:24:13 +00:00 (Migrated from github.com)
Review

Avoid using expect for error handling in production code.

Using expect can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message.

.get_result(&mut connection)
.map_err(|e| {
    eprintln!("Error saving a new project: {}", e);
    ServerFnError::from(e)
})
**Avoid using `expect` for error handling in production code.** Using `expect` can cause the program to panic on errors. Consider using proper error handling to return a meaningful error message. ```rust .get_result(&mut connection) .map_err(|e| { eprintln!("Error saving a new project: {}", e); ServerFnError::from(e) }) ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 20:12:41 +00:00 (Migrated from github.com)
Review

Consider removing the testing function.

The testing function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean.

**Consider removing the `testing` function.** The `testing` function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean. <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-08-18 20:12:41 +00:00 (Migrated from github.com)
Review

Consider removing the testing function.

The testing function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean.

**Consider removing the `testing` function.** The `testing` function is a simple utility that adds 1 to the input. If it's not used in production, consider removing it to keep the codebase clean. <!-- This is an auto-generated comment by CodeRabbit -->