feat: ability to create a project #9
@@ -1,4 +1,4 @@
 | 
			
		||||
| 
					
	
	
	
	
	
	
	
	 | 
			||||
use crate::components::form_project::FormProject;
 | 
			
		||||
| 
					
	
	
	
	
	
	
	
	 Consider adding error handling for the  The  **Consider adding error handling for the `create_project` call.**
The `create_project` function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.
```rust
onsubmit: move |title| {
    spawn(async move {
        if let Err(e) = create_project(title).await {
            // Handle the error, e.g., log it or display a message to the user
        }
    });
}
```
<!-- This is an auto-generated reply by CodeRabbit --> 
			
			
		This will be addressed in a later development stage. The project creation should probably result in a redirect. This will be addressed in a later development stage. The project creation should probably result in a redirect. 
			
			
		@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out. <!-- [monologue]
[observations] The user plans to handle error management and possibly implement a redirect after project creation in a future development stage.
[analysis] Since the user has acknowledged the suggestion and plans to address it later, there's no immediate action required. It's important to acknowledge their plan and offer assistance if needed.
[actions] Respond to the user acknowledging their plan and offering further assistance if required.
-->
@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.
<!-- This is an auto-generated reply by CodeRabbit --> 
			
			
		 | 
			||||
use crate::components::project_form::ProjectForm;
 | 
			
		||||
| 
					
	
	
	
	
	
	
	
	 Consider adding error handling for the  The  **Consider adding error handling for the `create_project` call.**
The `create_project` function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.
```rust
onsubmit: move |title| {
    spawn(async move {
        if let Err(e) = create_project(title).await {
            // Handle the error, e.g., log it or display a message to the user
        }
    });
}
```
<!-- This is an auto-generated reply by CodeRabbit --> 
			
			
		This will be addressed in a later development stage. The project creation should probably result in a redirect. This will be addressed in a later development stage. The project creation should probably result in a redirect. 
			
			
		@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out. <!-- [monologue]
[observations] The user plans to handle error management and possibly implement a redirect after project creation in a future development stage.
[analysis] Since the user has acknowledged the suggestion and plans to address it later, there's no immediate action required. It's important to acknowledge their plan and offer assistance if needed.
[actions] Respond to the user acknowledging their plan and offering further assistance if required.
-->
@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.
<!-- This is an auto-generated reply by CodeRabbit --> 
			
			
		 | 
			||||
use crate::server::projects::create_project;
 | 
			
		||||
use dioxus::core_macro::rsx;
 | 
			
		||||
use dioxus::dioxus_core::Element;
 | 
			
		||||
@@ -7,7 +7,7 @@ use dioxus::prelude::*;
 | 
			
		||||
| 
					
	
	
	
	
	
	
	
	 Consider adding error handling for the  The  **Consider adding error handling for the `create_project` call.**
The `create_project` function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.
```rust
onsubmit: move |title| {
    spawn(async move {
        if let Err(e) = create_project(title).await {
            // Handle the error, e.g., log it or display a message to the user
        }
    });
}
```
<!-- This is an auto-generated reply by CodeRabbit --> 
			
			
		Consider adding error handling for the  The  **Consider adding error handling for the `create_project` call.**
The `create_project` function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.
```rust
onsubmit: move |title| {
    spawn(async move {
        if let Err(e) = create_project(title).await {
            // Handle the error, e.g., log it or display a message to the user
        }
    });
}
```
<!-- This is an auto-generated reply by CodeRabbit --> 
			
			
		This will be addressed in a later development stage. The project creation should probably result in a redirect. This will be addressed in a later development stage. The project creation should probably result in a redirect. 
			
			
		This will be addressed in a later development stage. The project creation should probably result in a redirect. This will be addressed in a later development stage. The project creation should probably result in a redirect. 
			
			
		@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out. <!-- [monologue]
[observations] The user plans to handle error management and possibly implement a redirect after project creation in a future development stage.
[analysis] Since the user has acknowledged the suggestion and plans to address it later, there's no immediate action required. It's important to acknowledge their plan and offer assistance if needed.
[actions] Respond to the user acknowledging their plan and offering further assistance if required.
-->
@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.
<!-- This is an auto-generated reply by CodeRabbit --> 
			
			
		@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out. <!-- [monologue]
[observations] The user plans to handle error management and possibly implement a redirect after project creation in a future development stage.
[analysis] Since the user has acknowledged the suggestion and plans to address it later, there's no immediate action required. It's important to acknowledge their plan and offer assistance if needed.
[actions] Respond to the user acknowledging their plan and offering further assistance if required.
-->
@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.
<!-- This is an auto-generated reply by CodeRabbit --> 
			
			
		 | 
			||||
#[component]
 | 
			
		||||
pub(crate) fn Home() -> Element {
 | 
			
		||||
    rsx! {
 | 
			
		||||
        FormProject {
 | 
			
		||||
| 
					
	
	
	
	
	
	
	
	 Consider adding error handling for the  The  **Consider adding error handling for the `create_project` call.**
The `create_project` function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.
```rust
onsubmit: move |title| {
    spawn(async move {
        if let Err(e) = create_project(title).await {
            // Handle the error, e.g., log it or display a message to the user
        }
    });
}
```
<!-- This is an auto-generated reply by CodeRabbit --> 
			
			
		This will be addressed in a later development stage. The project creation should probably result in a redirect. This will be addressed in a later development stage. The project creation should probably result in a redirect. 
			
			
		@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out. <!-- [monologue]
[observations] The user plans to handle error management and possibly implement a redirect after project creation in a future development stage.
[analysis] Since the user has acknowledged the suggestion and plans to address it later, there's no immediate action required. It's important to acknowledge their plan and offer assistance if needed.
[actions] Respond to the user acknowledging their plan and offering further assistance if required.
-->
@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.
<!-- This is an auto-generated reply by CodeRabbit --> 
			
			
		 | 
			||||
        ProjectForm {
 | 
			
		||||
| 
					
	
	
	
	
	
	
	
	 Consider adding error handling for the  The  **Consider adding error handling for the `create_project` call.**
The `create_project` function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.
```rust
onsubmit: move |title| {
    spawn(async move {
        if let Err(e) = create_project(title).await {
            // Handle the error, e.g., log it or display a message to the user
        }
    });
}
```
<!-- This is an auto-generated reply by CodeRabbit --> 
			
			
		This will be addressed in a later development stage. The project creation should probably result in a redirect. This will be addressed in a later development stage. The project creation should probably result in a redirect. 
			
			
		@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out. <!-- [monologue]
[observations] The user plans to handle error management and possibly implement a redirect after project creation in a future development stage.
[analysis] Since the user has acknowledged the suggestion and plans to address it later, there's no immediate action required. It's important to acknowledge their plan and offer assistance if needed.
[actions] Respond to the user acknowledging their plan and offering further assistance if required.
-->
@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.
<!-- This is an auto-generated reply by CodeRabbit --> 
			
			
		 | 
			||||
            onsubmit: move |title| {
 | 
			
		||||
                spawn(async move {
 | 
			
		||||
                    let _ = create_project(title).await;
 | 
			
		||||
 
 | 
			
		||||
| 
					
	
	
	
	
	
	
	
	 Consider adding error handling for the  The  **Consider adding error handling for the `create_project` call.**
The `create_project` function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.
```rust
onsubmit: move |title| {
    spawn(async move {
        if let Err(e) = create_project(title).await {
            // Handle the error, e.g., log it or display a message to the user
        }
    });
}
```
<!-- This is an auto-generated reply by CodeRabbit --> 
			
			
		Consider adding error handling for the  The  **Consider adding error handling for the `create_project` call.**
The `create_project` function is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.
```rust
onsubmit: move |title| {
    spawn(async move {
        if let Err(e) = create_project(title).await {
            // Handle the error, e.g., log it or display a message to the user
        }
    });
}
```
<!-- This is an auto-generated reply by CodeRabbit --> 
			
			
		This will be addressed in a later development stage. The project creation should probably result in a redirect. This will be addressed in a later development stage. The project creation should probably result in a redirect. 
			
			
		This will be addressed in a later development stage. The project creation should probably result in a redirect. This will be addressed in a later development stage. The project creation should probably result in a redirect. 
			
			
		@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out. <!-- [monologue]
[observations] The user plans to handle error management and possibly implement a redirect after project creation in a future development stage.
[analysis] Since the user has acknowledged the suggestion and plans to address it later, there's no immediate action required. It's important to acknowledge their plan and offer assistance if needed.
[actions] Respond to the user acknowledging their plan and offering further assistance if required.
-->
@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.
<!-- This is an auto-generated reply by CodeRabbit --> 
			
			
		@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out. <!-- [monologue]
[observations] The user plans to handle error management and possibly implement a redirect after project creation in a future development stage.
[analysis] Since the user has acknowledged the suggestion and plans to address it later, there's no immediate action required. It's important to acknowledge their plan and offer assistance if needed.
[actions] Respond to the user acknowledging their plan and offering further assistance if required.
-->
@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.
<!-- This is an auto-generated reply by CodeRabbit --> 
			
			
		 | 
			||||
@@ -1,3 +1,3 @@
 | 
			
		||||
pub(crate) mod app;
 | 
			
		||||
pub(crate) mod form_project;
 | 
			
		||||
pub(crate) mod home;
 | 
			
		||||
pub(crate) mod project_form;
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ use dioxus::dioxus_core::Element;
 | 
			
		||||
| 
					
	
	
	
	
	
	
	
	 Handle potential panic from  The use of  **Handle potential panic from `unwrap()`.**
The use of `unwrap()` on `event.values().get("title")` could lead to a panic if the "title" field is missing. Consider handling this scenario gracefully to avoid runtime errors.
```rust
onsubmit: move |event| {
    if let Some(title) = event.values().get("title") {
        onsubmit(title.as_value());
    } else {
        // Handle the error, e.g., log a message or provide user feedback
    }
}
```
<!-- This is an auto-generated comment by CodeRabbit --> 
			
			
		Handle potential panic from  The use of  **Handle potential panic from `unwrap()`.**
The use of `unwrap()` on `event.values().get("title")` could lead to a panic if the "title" field is missing. Consider handling this scenario gracefully to avoid runtime errors.
```rust
onsubmit: move |event| {
    if let Some(title) = event.values().get("title") {
        onsubmit(title.as_value());
    } else {
        // Handle the error, e.g., log a message or provide user feedback
    }
}
```
<!-- This is an auto-generated comment by CodeRabbit --> 
			
			
		 | 
			||||
use dioxus::prelude::*;
 | 
			
		||||
 | 
			
		||||
#[component]
 | 
			
		||||
pub(crate) fn FormProject(onsubmit: EventHandler<String>) -> Element {
 | 
			
		||||
| 
					
	
	
	
	
	
	
	
	 Handle potential panic from  The use of  **Handle potential panic from `unwrap()`.**
The use of `unwrap()` on `event.values().get("title")` could lead to a panic if the "title" field is missing. Consider handling this scenario gracefully to avoid runtime errors.
```rust
onsubmit: move |event| {
    if let Some(title) = event.values().get("title") {
        onsubmit(title.as_value());
    } else {
        // Handle the error, e.g., log a message or provide user feedback
    }
}
```
<!-- This is an auto-generated comment by CodeRabbit --> 
			
			
		 | 
			||||
pub(crate) fn ProjectForm(onsubmit: EventHandler<String>) -> Element {
 | 
			
		||||
| 
					
	
	
	
	
	
	
	
	 Handle potential panic from  The use of  **Handle potential panic from `unwrap()`.**
The use of `unwrap()` on `event.values().get("title")` could lead to a panic if the "title" field is missing. Consider handling this scenario gracefully to avoid runtime errors.
```rust
onsubmit: move |event| {
    if let Some(title) = event.values().get("title") {
        onsubmit(title.as_value());
    } else {
        // Handle the error, e.g., log a message or provide user feedback
    }
}
```
<!-- This is an auto-generated comment by CodeRabbit --> 
			
			
		 | 
			||||
    rsx! {
 | 
			
		||||
        form {
 | 
			
		||||
            onsubmit: move |event| {
 | 
			
		||||
Consider adding error handling for the
create_projectcall.The
create_projectfunction is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.Consider adding error handling for the
create_projectcall.The
create_projectfunction is called asynchronously, but any potential errors are currently ignored. Consider handling errors to improve robustness and provide feedback to users.This will be addressed in a later development stage. The project creation should probably result in a redirect.
This will be addressed in a later development stage. The project creation should probably result in a redirect.
@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.
@matous-volf, that sounds like a good plan. If you need any assistance with implementing error handling or the redirect in the future, feel free to reach out.