|
|
|
@ -79,13 +79,14 @@ export class GroupSyncService {
|
|
|
|
|
private static async fetchGroupsFromAPI(): Promise<EvolutionGroup[]> {
|
|
|
|
|
const url = `${env.EVOLUTION_API_URL}/group/fetchAllGroups/${env.EVOLUTION_API_INSTANCE}?getParticipants=false`;
|
|
|
|
|
console.log('ℹ️ Fetching groups from API:', {
|
|
|
|
|
url: `${url.substring(0, 50)}...`, // Log partial URL for security
|
|
|
|
|
url: `${url}...`, // Log partial URL for security
|
|
|
|
|
communityId: env.WHATSAPP_COMMUNITY_ID,
|
|
|
|
|
time: new Date().toISOString()
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const response = await fetch(url, {
|
|
|
|
|
method: 'GET',
|
|
|
|
|
headers: {
|
|
|
|
|
apikey: env.EVOLUTION_API_KEY,
|
|
|
|
|
},
|
|
|
|
@ -105,6 +106,7 @@ export class GroupSyncService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const data = await response.json();
|
|
|
|
|
console.log(data);
|
|
|
|
|
console.log('ℹ️ API response:', {
|
|
|
|
|
status: data.status,
|
|
|
|
|
message: data.message,
|
|
|
|
|