Skip to content

Commit

Permalink
Added checking if application is initialized when at start for table …
Browse files Browse the repository at this point in the history
…operations
  • Loading branch information
amigin committed May 19, 2022
1 parent b0ab7cf commit ac09e83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/http/controllers/tables_controller/get_list_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ async fn handle_request(
action: &GetListAction,
_ctx: &mut HttpContext,
) -> Result<HttpOkResult, HttpFailResult> {
crate::db_operations::check_app_states(action.app.as_ref())?;
let tables = action.app.db.get_tables().await;

let mut response: Vec<TableContract> = vec![];
Expand Down
2 changes: 2 additions & 0 deletions src/http/controllers/tables_controller/table_size_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ async fn handle_request(
input_data: GetTableSizeContract,
_ctx: &HttpContext,
) -> Result<HttpOkResult, HttpFailResult> {
crate::db_operations::check_app_states(action.app.as_ref())?;

let db_table =
crate::db_operations::read::table::get(action.app.as_ref(), input_data.table_name.as_str())
.await?;
Expand Down

0 comments on commit ac09e83

Please sign in to comment.