Fix macro list/delete
This commit is contained in:
parent
748e33566b
commit
b6ff149d51
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -2431,7 +2431,7 @@ checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56"
|
||||
|
||||
[[package]]
|
||||
name = "reminder-rs"
|
||||
version = "1.7.24"
|
||||
version = "1.7.26"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"chrono",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "reminder-rs"
|
||||
version = "1.7.24"
|
||||
version = "1.7.26"
|
||||
authors = ["Jude Southworth <judesouthworth@pm.me>"]
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0 only"
|
||||
|
@ -20,7 +20,7 @@ pub async fn delete_macro(
|
||||
SELECT m.id
|
||||
FROM command_macro m
|
||||
INNER JOIN guilds
|
||||
ON guilds.guild = m.guild_id
|
||||
ON guilds.id = m.guild_id
|
||||
WHERE guild = ?
|
||||
AND m.name = ?
|
||||
",
|
||||
|
@ -68,7 +68,7 @@ impl Data {
|
||||
guild_id: GuildId,
|
||||
) -> Result<Vec<CommandMacro>, Error> {
|
||||
let rows = sqlx::query!(
|
||||
"SELECT name, description, commands FROM macro WHERE guild_id = (SELECT id FROM guilds WHERE guild = ?)",
|
||||
"SELECT name, description, commands FROM command_macro WHERE guild_id = (SELECT id FROM guilds WHERE guild = ?)",
|
||||
guild_id.get()
|
||||
)
|
||||
.fetch_all(&self.database)
|
||||
@ -76,7 +76,7 @@ impl Data {
|
||||
guild_id,
|
||||
name: row.name.clone(),
|
||||
description: row.description.clone(),
|
||||
commands: serde_json::from_str(&row.commands).unwrap(),
|
||||
commands: serde_json::from_str(&row.commands.to_string()).unwrap(),
|
||||
}).collect();
|
||||
|
||||
Ok(rows)
|
||||
|
Loading…
Reference in New Issue
Block a user