parent
210642f287
commit
e876942892
1 changed files with 2 additions and 4 deletions
|
|
@ -81,7 +81,6 @@ export async function addChannelToDefaultCategory(serverUrl: string, channel: Ch
|
|||
return {error: 'no current user id'};
|
||||
}
|
||||
|
||||
const models: Model[] = [];
|
||||
const categoriesWithChannels: CategoryWithChannels[] = [];
|
||||
|
||||
if (isDMorGM(channel)) {
|
||||
|
|
@ -101,11 +100,10 @@ export async function addChannelToDefaultCategory(serverUrl: string, channel: Ch
|
|||
cwc.channel_ids.unshift(channel.id);
|
||||
categoriesWithChannels.push(cwc);
|
||||
}
|
||||
|
||||
const ccModels = await prepareCategoryChannels(operator, categoriesWithChannels);
|
||||
models.push(...ccModels);
|
||||
}
|
||||
|
||||
const models = await prepareCategoryChannels(operator, categoriesWithChannels);
|
||||
|
||||
if (models.length && !prepareRecordsOnly) {
|
||||
await operator.batchRecords(models);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue