v1.3.29: ignora HTTP 409 duplicate (ja existe = ok)
Build Fechamento de Caixa / build (macos-14, app) (push) Has been cancelled
Build Fechamento de Caixa / build (ubuntu-22.04, deb) (push) Has been cancelled
Build Fechamento de Caixa / build (windows-2022, msi) (push) Has been cancelled

This commit is contained in:
root
2026-06-27 23:54:07 +00:00
parent 5e6f8b09a9
commit 00fa17fa52
+2 -2
View File
@@ -142,7 +142,7 @@ impl SupabaseClient {
"frango": estado.get("frango").and_then(|v| v.as_i64()).unwrap_or(0),
});
// Upsert via POST com Prefer: resolution=merge-duplicates
// Primeiro tenta INSERT (upsert via Prefer)
let resp = self
.http
.post(&format!("{}/rest/v1/fechamentos_web", self.base_url))
@@ -152,7 +152,7 @@ impl SupabaseClient {
.send()?;
let status = resp.status();
if status.is_success() {
if status.is_success() || status.as_u16() == 409 {
Ok(serde_json::json!({ "ok": true, "id_fechamento": id_fechamento }))
} else {
let body = resp.text().unwrap_or_default();