console.log('ℹ️ Received wrapped response with',groups.length,'groups');
}else{
thrownewError('Invalid API response format - expected array or wrapped response');
@ -344,8 +344,8 @@ export class GroupSyncService {
}
privatestaticgetActiveGroupsCount():number{
constresult=this.dbInstance.prepare('SELECT COUNT(*) as count FROM groups WHERE active = TRUE AND COALESCE(is_community,0) = 0 AND COALESCE(archived,0) = 0').get();
returnresult?.count||0;
constresult=this.dbInstance.prepare('SELECT COUNT(*) as count FROM groups WHERE active = TRUE AND COALESCE(is_community,0) = 0 AND COALESCE(archived,0) = 0').get()as{count?: number}|undefined;
returnNumber(result?.count||0);
}
staticasynccheckInitialGroups():Promise<void>{
@ -429,7 +429,7 @@ export class GroupSyncService {
});
for(constgroupofgroups){
constexisting=this.dbInstance.prepare('SELECT 1 FROM groups WHERE id = ?').get(group.id);
constexisting=this.dbInstance.prepare('SELECT 1 FROM groups WHERE id = ?').get((groupasEvolutionGroup).id);
@ -437,13 +437,13 @@ export class GroupSyncService {
if(existing){
constupdateResult=this.dbInstance.prepare(
'UPDATE groups SET name = ?, community_id = COALESCE(?, community_id), is_community = ?, active = TRUE, last_verified = CURRENT_TIMESTAMP WHERE id = ?'