A tonne of updates; site info, documentation, campaign phone numbers, soccial share buttons, and several other things
This commit is contained in:
@@ -25,7 +25,8 @@ class NocoDBService {
|
||||
postalCodes: process.env.NOCODB_TABLE_POSTAL_CODES,
|
||||
campaigns: process.env.NOCODB_TABLE_CAMPAIGNS,
|
||||
campaignEmails: process.env.NOCODB_TABLE_CAMPAIGN_EMAILS,
|
||||
users: process.env.NOCODB_TABLE_USERS
|
||||
users: process.env.NOCODB_TABLE_USERS,
|
||||
calls: process.env.NOCODB_TABLE_CALLS
|
||||
};
|
||||
|
||||
// Validate that all table IDs are set
|
||||
@@ -381,7 +382,9 @@ class NocoDBService {
|
||||
async getAllCampaigns() {
|
||||
try {
|
||||
const response = await this.getAll(this.tableIds.campaigns, {
|
||||
sort: '-CreatedAt'
|
||||
sort: '-CreatedAt',
|
||||
// Explicitly request all fields to ensure newly added columns are included
|
||||
fields: '*'
|
||||
});
|
||||
return response.list || [];
|
||||
} catch (error) {
|
||||
@@ -543,6 +546,24 @@ class NocoDBService {
|
||||
}
|
||||
}
|
||||
|
||||
async getCampaignCallCount(campaignId) {
|
||||
try {
|
||||
if (!this.tableIds.calls) {
|
||||
console.warn('Calls table not configured, returning 0');
|
||||
return 0;
|
||||
}
|
||||
|
||||
const response = await this.getAll(this.tableIds.calls, {
|
||||
where: `(Campaign ID,eq,${campaignId})`,
|
||||
limit: 1000 // Get enough to count
|
||||
});
|
||||
return response.pageInfo ? response.pageInfo.totalRows : (response.list ? response.list.length : 0);
|
||||
} catch (error) {
|
||||
console.error('Get campaign call count failed:', error);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
async getCampaignAnalytics(campaignId) {
|
||||
try {
|
||||
const response = await this.getAll(this.tableIds.campaignEmails, {
|
||||
|
||||
Reference in New Issue
Block a user