// JavaScript Example: Reading Entities
// Filterable fields: property_address, client_name, client_email, client_phone, sales_rep, stage, sale_price, commission_rate, commission_amount, property_type, settlement_date, notes
async function fetchDealEntities() {
const response = await fetch(`/api/apps/69c4a0cdda5b4ff2995c3e17/entities/Deal`, {
headers: {
'api_key': 'e01875b0ff124fc0b5bcd494deff67ca', // or use await User.me() to get the API key
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
}
// JavaScript Example: Updating an Entity
// Filterable fields: property_address, client_name, client_email, client_phone, sales_rep, stage, sale_price, commission_rate, commission_amount, property_type, settlement_date, notes
async function updateDealEntity(entityId, updateData) {
const response = await fetch(`/api/apps/69c4a0cdda5b4ff2995c3e17/entities/Deal/${entityId}`, {
method: 'PUT',
headers: {
'api_key': 'e01875b0ff124fc0b5bcd494deff67ca', // or use await User.me() to get the API key
'Content-Type': 'application/json'
},
body: JSON.stringify(updateData)
});
const data = await response.json();
console.log(data);
}













































