feat: Minhas folhas on the Site: save a cart item to the account, order it again with the files already on the server, edit it without sending them again (Rodada 5, B9)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-30 16:09:52 -03:00
parent 5671235681
commit 3428ff68be
5 changed files with 156 additions and 8 deletions

View File

@@ -43,6 +43,7 @@
// A signed-in customer's details come from the account, with the saved
// delivery address, whether or not a cart was recovered.
const account=await window.dtfApi('/account/me');
window.dtfContaAberta=!!account.customer;
const c=account.customer;
if(c && !cliente.mail){
cliente={name:c.name||'',cnpj:c.cnpj,zap:c.zap,mail:c.mail};
@@ -57,6 +58,9 @@
}
pintaEntrega();
}
// The account's save button only exists after this answer.
window.dispatchEvent(new Event('dtf-cart-changed'));
if(typeof pintaPedido==='function') pintaPedido();
}catch(error){notice.textContent='Recuperação de carrinho indisponível; o pedido ainda pode ser feito nesta sessão.';}
finally{restoring=false;}
})();