feat: ability to view tasks in a category #19

Merged
matous-volf merged 15 commits from feat/tasks-in-category-list into main 2024-09-06 06:07:35 +00:00
3 changed files with 47 additions and 0 deletions
Showing only changes of commit 7c16bc4546 - Show all commits

View File

@ -4,6 +4,7 @@ mod models;
mod route;
mod schema;
mod server;
mod query;
use components::app::App;
use dioxus::prelude::*;

22
src/query/mod.rs Normal file
View File

@ -0,0 +1,22 @@
use crate::errors::error::Error;
use crate::errors::error_vec::ErrorVec;
use crate::models::category::Category;
use crate::models::task::Task;
pub(crate) mod tasks;
#[derive(PartialEq, Debug)]
pub(crate) enum QueryValue {
Tasks(Vec<Task>),
}
#[derive(Debug)]
pub(crate) enum QueryErrors {
Error(ErrorVec<Error>),
}
#[derive(PartialEq, Eq, Hash, Clone, Debug)]
pub(crate) enum QueryKey {
Tasks,
TasksInCategory(Category),
}

24
src/query/tasks.rs Normal file
View File

@ -0,0 +1,24 @@
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
use dioxus::prelude::ServerFnError;
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
use dioxus_query::prelude::{use_get_query, QueryResult, UseQuery};
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
use crate::models::category::Category;
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
use crate::query::{QueryErrors, QueryKey, QueryValue};
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
use crate::server::tasks::get_tasks_in_category;
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
pub(crate) fn use_tasks_in_category_query(category: Category)
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
-> UseQuery<QueryValue, QueryErrors, QueryKey> {
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
use_get_query([QueryKey::TasksInCategory(category), QueryKey::Tasks], fetch_tasks_in_category)
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
}
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
async fn fetch_tasks_in_category(keys: Vec<QueryKey>) -> QueryResult<QueryValue, QueryErrors> {
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
if let Some(QueryKey::TasksInCategory(category)) = keys.first() {
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
match get_tasks_in_category(category.clone()).await {
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
Ok(tasks) => Ok(QueryValue::Tasks(tasks)),
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
Err(ServerFnError::WrappedServerError(errors)) => Err(QueryErrors::Error(errors)),
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
Err(error) => panic!("Unexpected error: {:?}", error)
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
}.into()
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
} else {
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
panic!("Unexpected query keys: {:?}", keys);
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
}
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
}
coderabbitai[bot] commented 2024-09-05 16:27:30 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-09-05 18:56:12 +00:00 (Migrated from github.com)
Review

Consider improving error handling in fetch_tasks_in_category.

The use of panic! for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead.

Suggested changes to improve error handling:

Err(error) => {
    log::error!("Unexpected error: {:?}", error);
    Err(QueryErrors::UnexpectedError)
}

And for the unexpected keys:

else {
    log::warn!("Unexpected query keys: {:?}", keys);
    Err(QueryErrors::InvalidQuery)
}
**Consider improving error handling in `fetch_tasks_in_category`.** The use of `panic!` for handling unexpected errors (lines 19 and 22) is risky in a production environment as it can cause the application to crash. Consider logging these errors or returning a controlled error response instead. Suggested changes to improve error handling: ```rust Err(error) => { log::error!("Unexpected error: {:?}", error); Err(QueryErrors::UnexpectedError) } ``` And for the unexpected keys: ```rust else { log::warn!("Unexpected query keys: {:?}", keys); Err(QueryErrors::InvalidQuery) } ``` <!-- This is an auto-generated comment by CodeRabbit -->