feat: implementada funcionalidade de exclusao de leads via API e botoes na interface (Kanban, Tabela Analitica e Modal)
This commit is contained in:
@@ -88,19 +88,29 @@ def render_analytical_table_view(api_client: APIClient):
|
||||
)
|
||||
|
||||
st.markdown("### ⚙️ Ações Rápidas")
|
||||
col_sel, col_act = st.columns([2, 1])
|
||||
col_sel, col_opt, col_del = st.columns([2, 1, 1])
|
||||
with col_sel:
|
||||
selected_lead_id = st.selectbox(
|
||||
"Selecione um Lead para Ação LGPD:",
|
||||
"Selecione um Lead para Ação:",
|
||||
options=[l['id'] for l in filtered],
|
||||
format_func=lambda x: next((f"{l['nome_empresa']} ({l['status_funil']})" for l in filtered if l['id'] == x), x)
|
||||
)
|
||||
|
||||
with col_act:
|
||||
if st.button("🚫 Marcar Opt-Out (LGPD)", type="secondary", use_container_width=True):
|
||||
with col_opt:
|
||||
if st.button("🚫 Opt-Out (LGPD)", type="secondary", use_container_width=True):
|
||||
if selected_lead_id:
|
||||
api_client.opt_out_lead(selected_lead_id)
|
||||
st.success("Lead marcado como Opt-Out (Excluído / LGPD).")
|
||||
st.rerun()
|
||||
|
||||
with col_del:
|
||||
if st.button("🗑️ Deletar do Banco", type="primary", use_container_width=True):
|
||||
if selected_lead_id:
|
||||
ok, msg = api_client.delete_lead(selected_lead_id)
|
||||
if ok:
|
||||
st.success(msg)
|
||||
else:
|
||||
st.error(msg)
|
||||
st.rerun()
|
||||
else:
|
||||
st.info("Nenhum lead encontrado com os filtros selecionados.")
|
||||
|
||||
Reference in New Issue
Block a user