Fix list deletion sync: SyncAction::DeleteList

- Added DeleteList variant to SyncAction enum
- Added ApiClient::delete_list() calling DELETE /users/@me/lists/{id}
- List deletion uses DeleteList action (not Delete/delete_task)
- Sync engine handles DeleteList calling api.delete_list()
This commit is contained in:
Ruben Rosario
2026-06-21 18:27:53 +01:00
parent a35eab35af
commit 9649ca96b0
5 changed files with 37 additions and 6 deletions
+25
View File
@@ -402,6 +402,31 @@ impl ApiClient {
Ok(())
}
pub async fn delete_list(&self, list_id: &str) -> Result<(), ApiError> {
let token = self.get_token().await?;
let url = format!(
"https://tasks.googleapis.com/tasks/v1/users/@me/lists/{}",
list_id
);
let resp = self
.client
.delete(&url)
.bearer_auth(&token)
.send()
.await
.map_err(|e| ApiError::Network(e.to_string()))?;
if !resp.status().is_success() {
let status = resp.status();
let body = resp.text().await.unwrap_or_default();
return Err(ApiError::Api(format!("Delete list failed: {} - {}", status, body)));
}
Ok(())
}
pub async fn move_task(
&self,
list_id: &str,