forked from admin/zeropost-engine
feat: vk_access_token в updateable fields
This commit is contained in:
@@ -115,7 +115,8 @@ async function updateChannel(channelId, userId, data) {
|
|||||||
// обновить channels
|
// обновить channels
|
||||||
if (Object.keys(channelFields).length) {
|
if (Object.keys(channelFields).length) {
|
||||||
const fields = ['name', 'tg_channel_id', 'tg_username', 'bot_token',
|
const fields = ['name', 'tg_channel_id', 'tg_username', 'bot_token',
|
||||||
'niche', 'audience', 'goal', 'language', 'region', 'is_active'];
|
'niche', 'audience', 'goal', 'language', 'region', 'is_active',
|
||||||
|
'vk_access_token'];
|
||||||
const updates = fields.filter(f => channelFields[f] !== undefined);
|
const updates = fields.filter(f => channelFields[f] !== undefined);
|
||||||
if (updates.length) {
|
if (updates.length) {
|
||||||
const setClauses = updates.map((f, i) => `${f}=$${i + 1}`).join(', ');
|
const setClauses = updates.map((f, i) => `${f}=$${i + 1}`).join(', ');
|
||||||
|
|||||||
Reference in New Issue
Block a user