AG

Arberg Purchasing

Enter the shared password

etTimeout(()=>{b.style.display='none';b.textContent='Reading the image with Claude…';},1800);return; } document.getElementById('spin').style.display='none'; } async function saveItem(){ const item=document.getElementById('fItem').value.trim(); if(!item){document.getElementById('fItem').focus();return;} const btn=document.getElementById('saveBtn');btn.disabled=true;btn.textContent='Saving…'; const props={Item:{title:[{text:{content:item}}]},Status:{select:{name:'Requested'}},Source:{select:{name:'Discord Image'}}, 'Submitted By':{rich_text:[{text:{content:'purchasing app'}}]}}; const qty=parseFloat(document.getElementById('fQty').value);if(!isNaN(qty))props.Quantity={number:qty}; const unit=document.getElementById('fUnit').value;if(unit)props.Unit={select:{name:unit}}; const proj=document.getElementById('fProj').value.trim();if(proj)props['Project Name']={rich_text:[{text:{content:proj}}]}; const store=document.getElementById('fStore').value;if(store)props.Store={select:{name:store}}; const price=parseFloat(document.getElementById('fPrice').value);if(!isNaN(price))props.Price={number:price}; const sku=document.getElementById('fSku').value.trim();if(sku)props.SKU={rich_text:[{text:{content:sku}}]}; const url=document.getElementById('fUrl').value.trim();if(url)props['Product URL']={url:url}; try{ const r=await fetch(WRITE,{method:'POST',headers:{'Content-Type':'application/json'}, body:JSON.stringify({action:'create',database_id:DB_ID,properties:props})}); if(!r.ok)throw 0; closeAdd();btn.disabled=false;btn.textContent='Add to list';load(); }catch(e){btn.disabled=false;btn.textContent='Retry';} }