Your one-stop-cake-shop for everything Freshly Baked has to offer

feat(menu): allow overwriting links #162

merged opened by a.starrysky.fyi targeting main from private/minion/push-znnulvoxwzkq

Previously when a link was put into menu it was impossible to overwrite it without editing the database. Instead, we can change our INSERT to an UPSERT to allow that. This lets me fix typos (such as y/bsky missing the /profile/ path)

Labels

None yet.

requested-reviewers

None yet.

approved

None yet.

tested-working

None yet.

rejected

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:uuyqs6y3pwtbteet4swt5i5y/sh.tangled.repo.pull/3mbwyxbwgb422
+6 -3
Diff #1
+2 -2
menu/.sqlx/query-735cda2fe387b6b852a03ba7ccba41353667bd505f80c1cfe3ad16b738b45ba5.json menu/.sqlx/query-9eecf9b43e5458bc95fc45fe8e48d6da5edb50cdbf1e7a478faf310d6b9022ad.json
··· 1 1 { 2 2 "db_name": "PostgreSQL", 3 - "query": "INSERT INTO direct (\"from\", \"to\", \"owner\") VALUES ($1, $2, $3)", 3 + "query": "INSERT INTO direct (\"from\", \"to\", \"owner\") VALUES ($1, $2, $3) ON CONFLICT (\"from\") DO UPDATE SET \"to\" = EXCLUDED.to, \"owner\" = EXCLUDED.owner", 4 4 "describe": { 5 5 "columns": [], 6 6 "parameters": { ··· 12 12 }, 13 13 "nullable": [] 14 14 }, 15 - "hash": "735cda2fe387b6b852a03ba7ccba41353667bd505f80c1cfe3ad16b738b45ba5" 15 + "hash": "9eecf9b43e5458bc95fc45fe8e48d6da5edb50cdbf1e7a478faf310d6b9022ad" 16 16 }
+3
menu/.sqlx/query-9eecf9b43e5458bc95fc45fe8e48d6da5edb50cdbf1e7a478faf310d6b9022ad.json.license
··· 1 + SPDX-FileCopyrightText: 2026 Freshly Baked Cake 2 + 3 + SPDX-License-Identifier: CC0-1.0
+1 -1
menu/src/main.rs
··· 139 139 }; 140 140 141 141 let create_call = sqlx::query!( 142 - r#"INSERT INTO direct ("from", "to", "owner") VALUES ($1, $2, $3)"#, 142 + r#"INSERT INTO direct ("from", "to", "owner") VALUES ($1, $2, $3) ON CONFLICT ("from") DO UPDATE SET "to" = EXCLUDED.to, "owner" = EXCLUDED.owner"#, 143 143 create.from.to_lowercase(), 144 144 create.to, 145 145 owner,

History

2 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
feat(menu): allow overwriting links
1/5 failed, 4/5 success
expand
expand 0 comments
pull request successfully merged
1 commit
expand
feat(menu): allow overwriting links
1/5 failed, 4/5 success
expand
expand 0 comments