mirror of https://github.com/TaKO8Ki/gobang
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
493 B
Rust
16 lines
493 B
Rust
3 years ago
|
use crate::app::App;
|
||
|
use crate::event::Key;
|
||
|
use crate::utils::get_records;
|
||
|
|
||
|
pub async fn handler(_key: Key, app: &mut App) -> anyhow::Result<()> {
|
||
|
if let Some(database) = app.selected_database() {
|
||
|
if let Some(table) = app.selected_table() {
|
||
|
let (headers, records) =
|
||
|
get_records(database, table, app.pool.as_ref().unwrap()).await?;
|
||
|
app.record_table.headers = headers;
|
||
|
app.record_table.rows = records;
|
||
|
}
|
||
|
}
|
||
|
Ok(())
|
||
|
}
|