1
0
Fork 0
mirror of https://github.com/SinTan1729/chhoto-url synced 2025-04-19 19:30:01 -05:00

Compare commits

..

2 commits

Author SHA1 Message Date
1ae00eb3a8
chg: Some cosmetic changes to login dialog 2025-03-03 14:16:38 -06:00
6f419c7b3d
new: Enforce ordering of data
Closes #46
Data is returned in order of id, which should match the order it was
inserted in. In the WebUI, the entries are shown in reverse, so the
latest link is at the top.
2025-03-03 12:27:59 -06:00
3 changed files with 8 additions and 3 deletions

View file

@ -33,7 +33,7 @@ pub fn find_url(shortlink: &str, db: &Connection, needhits: bool) -> (Option<Str
// Get all URLs in DB
pub fn getall(db: &Connection) -> Vec<DBRow> {
let mut statement = db
.prepare_cached("SELECT * FROM urls")
.prepare_cached("SELECT * FROM urls ORDER BY id ASC")
.expect("Error preparing SQL statement for getall.");
let mut data = statement

View file

@ -56,7 +56,7 @@ const refreshData = async () => {
}
} else {
let data = await res.json();
displayData(data);
displayData(data.reverse());
}
}

View file

@ -86,7 +86,12 @@ div[name="links-div"] {
margin-bottom: 10px;
}
dialog form {
#login-dialog {
border-radius: 10px;
border-width: 2px;
}
#login-dialog form {
text-align: center;
}