fix: aumenta janela de atribuição para 30min e sanitiza hostname no frontend

- attribution_matcher_service: window 10min → 30min (mais realista para jornada do lead)
- LandingHostsConfig.vue: strip automático de https://, www e trailing slash antes de salvar
This commit is contained in:
Rodrigo Borba 2026-03-02 15:35:05 -03:00
parent 118f52e239
commit a73689dce4
2 changed files with 11 additions and 2 deletions

View File

@ -74,12 +74,21 @@ export default {
async addHost() {
if (!this.newHostname.trim()) return;
this.isSaving = true;
// Sanitiza: remove protocolo, www, barras e espaços
const cleanHostname = this.newHostname
.trim()
.toLowerCase()
.replace(/^https?:\/\//i, '')
.replace(/^www\./, '')
.replace(/\/.*$/, '');
try {
const { data } = await landingHostsApi.createHost(
this.currentAccountId,
this.inbox.id,
{
hostname: this.newHostname.trim().toLowerCase(),
hostname: cleanHostname,
unit_code: this.newUnitCode.trim().toUpperCase(),
}
);

View File

@ -25,7 +25,7 @@ class Leads::AttributionMatcherService
def find_matching_click
base_query = LeadClick
.where(status: :clicked, inbox_id: @inbox_id)
.where('created_at > ?', 10.minutes.ago)
.where('created_at > ?', 30.minutes.ago)
return base_query.where(ip: @inbound_ip).order(created_at: :desc).first if @inbound_ip.present?