fix: salvar edicao com id numerico, relatorio cartoes detalhado
This commit is contained in:
@@ -247,11 +247,11 @@ impl SupabaseClient {
|
||||
}
|
||||
}
|
||||
|
||||
/// Atualiza campos específicos de um fechamento pelo id (PATCH).
|
||||
pub fn atualizar_fechamento(&self, uuid: &str, updates: &serde_json::Value) -> Result<Value, SupabaseError> {
|
||||
/// Atualiza campos específicos de um fechamento pelo id numérico (PATCH).
|
||||
pub fn atualizar_fechamento(&self, id: i64, updates: &serde_json::Value) -> Result<Value, SupabaseError> {
|
||||
let url = format!(
|
||||
"{}/rest/v1/fechamentos_web?id=eq.{}",
|
||||
self.base_url, uuid
|
||||
self.base_url, id
|
||||
);
|
||||
|
||||
let resp = self
|
||||
@@ -262,7 +262,7 @@ impl SupabaseClient {
|
||||
.send()?;
|
||||
|
||||
if resp.status().is_success() {
|
||||
Ok(serde_json::json!({ "ok": true, "uuid": uuid }))
|
||||
Ok(serde_json::json!({ "ok": true, "id": id }))
|
||||
} else {
|
||||
let status = resp.status();
|
||||
let body = resp.text().unwrap_or_default();
|
||||
@@ -462,10 +462,10 @@ pub fn sb_buscar_por_id_fechamento(
|
||||
#[tauri::command]
|
||||
pub fn sb_atualizar_fechamento(
|
||||
sb: State<'_, SupabaseClient>,
|
||||
uuid: String,
|
||||
id: i64,
|
||||
updates: serde_json::Value,
|
||||
) -> Result<serde_json::Value, SupabaseError> {
|
||||
sb.atualizar_fechamento(&uuid, &updates)
|
||||
sb.atualizar_fechamento(id, &updates)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
||||
Reference in New Issue
Block a user