feat: add address field to lead form
This commit is contained in:
@@ -24,6 +24,7 @@ export default function LeadsScreen() {
|
||||
const [showAdd, setShowAdd] = useState(false);
|
||||
const [newName, setNewName] = useState('');
|
||||
const [newPhone, setNewPhone] = useState('');
|
||||
const [newAddress, setNewAddress] = useState('');
|
||||
const [newNotes, setNewNotes] = useState('');
|
||||
const [saving, setSaving] = useState(false);
|
||||
|
||||
@@ -47,10 +48,11 @@ export default function LeadsScreen() {
|
||||
await api.post('/api/v1/leads', {
|
||||
firstName, lastName,
|
||||
phone: newPhone.trim(),
|
||||
...(newAddress.trim() ? { address: newAddress.trim() } : {}),
|
||||
...(newNotes.trim() ? { notes: newNotes.trim() } : {}),
|
||||
});
|
||||
setShowAdd(false);
|
||||
setNewName(''); setNewPhone(''); setNewNotes('');
|
||||
setNewName(''); setNewPhone(''); setNewAddress(''); setNewNotes('');
|
||||
qc.invalidateQueries({ queryKey: ['leads'] });
|
||||
refetch();
|
||||
} catch (e: any) {
|
||||
@@ -169,6 +171,13 @@ export default function LeadsScreen() {
|
||||
style={{ borderWidth: 1.5, borderColor: '#E2E8F0', borderRadius: 12, paddingHorizontal: 14, paddingVertical: 13, fontSize: 16, color: '#1E293B', marginBottom: 14 }}
|
||||
/>
|
||||
|
||||
<Text style={{ fontSize: 13, fontWeight: '600', color: '#64748B', marginBottom: 6 }}>Address (optional)</Text>
|
||||
<TextInput
|
||||
value={newAddress} onChangeText={setNewAddress}
|
||||
placeholder="Sitio, Barangay, Municipality..."
|
||||
style={{ borderWidth: 1.5, borderColor: '#E2E8F0', borderRadius: 12, paddingHorizontal: 14, paddingVertical: 13, fontSize: 16, color: '#1E293B', marginBottom: 14 }}
|
||||
/>
|
||||
|
||||
<Text style={{ fontSize: 13, fontWeight: '600', color: '#64748B', marginBottom: 6 }}>Notes (optional)</Text>
|
||||
<TextInput
|
||||
value={newNotes} onChangeText={setNewNotes}
|
||||
|
||||
Reference in New Issue
Block a user