A bit of clean up
This commit is contained in:
parent
cb2483eab1
commit
a590d7e1e9
24 changed files with 259 additions and 237 deletions
|
|
@ -22,10 +22,10 @@ impl Connection {
|
|||
if let Some(user_id) = user_id {
|
||||
sqlx::query_as(
|
||||
r#"
|
||||
SELECT [id], [title]
|
||||
FROM [Recipe]
|
||||
WHERE [is_published] = true AND ([lang] = $1 OR [user_id] = $2)
|
||||
ORDER BY [title] COLLATE NOCASE
|
||||
SELECT [id], [title]
|
||||
FROM [Recipe]
|
||||
WHERE [is_published] = true AND ([lang] = $1 OR [user_id] = $2)
|
||||
ORDER BY [title] COLLATE NOCASE
|
||||
"#,
|
||||
)
|
||||
.bind(lang)
|
||||
|
|
@ -33,10 +33,10 @@ impl Connection {
|
|||
} else {
|
||||
sqlx::query_as(
|
||||
r#"
|
||||
SELECT [id], [title]
|
||||
FROM [Recipe]
|
||||
WHERE [is_published] = true AND [lang] = $1
|
||||
ORDER BY [title] COLLATE NOCASE
|
||||
SELECT [id], [title]
|
||||
FROM [Recipe]
|
||||
WHERE [is_published] = true AND [lang] = $1
|
||||
ORDER BY [title] COLLATE NOCASE
|
||||
"#,
|
||||
)
|
||||
.bind(lang)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue