new finctions and fixes

This commit is contained in:
Mateusz Gruszczyński
2026-07-30 00:12:48 +02:00
parent 9ca055de5f
commit 2274cf57c9
31 changed files with 1348 additions and 505 deletions
+26
View File
@@ -944,6 +944,22 @@ pub async fn confirm_account_action(
.execute(&mut *tx)
.await
.map_err(AuthError::database)?;
sqlx::query(queries::get(
state.db.kind(),
queries::RESOURCE_COLORS_DELETE_BY_USER,
))
.bind(user_id)
.execute(&mut *tx)
.await
.map_err(AuthError::database)?;
sqlx::query(queries::get(
state.db.kind(),
queries::EDITOR_PREFERENCES_DELETE_BY_USER,
))
.bind(user_id)
.execute(&mut *tx)
.await
.map_err(AuthError::database)?;
sqlx::query(queries::get(state.db.kind(), queries::AUTH_ANONYMIZE_USER))
.bind(&deleted_nickname)
.bind(normalize(&deleted_nickname))
@@ -1143,6 +1159,13 @@ pub async fn delete_resource(
.await
.map_err(AuthError::database)?;
for note in notes {
crate::db::delete_resource_editor_state(
&state.db,
"note",
&format!("{}/{}", req.slug.trim(), note.slug),
)
.await
.map_err(AuthError::database)?;
let files = crate::db::list_note_files(&state.db, note.id)
.await
.map_err(AuthError::database)?;
@@ -1161,6 +1184,9 @@ pub async fn delete_resource(
queries::USER_DELETE_WORKSPACE
}
"pad" => {
crate::db::delete_resource_editor_state(&state.db, "pad", req.slug.trim())
.await
.map_err(AuthError::database)?;
if let Some(pad) = crate::db::find_pad(&state.db, req.slug.trim())
.await
.map_err(AuthError::database)?