v1.3.29: ignora HTTP 409 duplicate (ja existe = ok)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user