forked from admin/zeropost-engine
fix: getChannel arg order, postImages via Nyxos /images/generations
generate.js: getChannel(userId, channelId) → getChannel(channelId, userId) channels.js: getChannel alias → getFullChannel postImages.js: убран /responses + gpt-5.5 (не работал на aiprimetech), заменён на Nyxos /images/generations с fallback на aiguoguo
This commit is contained in:
@@ -50,7 +50,7 @@ router.post('/transform', async (req, res) => {
|
||||
if (!channelId || !originalPost || !action) {
|
||||
return res.status(400).json({ error: 'channelId, originalPost, action required' });
|
||||
}
|
||||
const channel = await channelsSvc.getChannel(userId, channelId);
|
||||
const channel = await channelsSvc.getChannel(channelId, userId);
|
||||
if (!channel) return res.status(404).json({ error: 'Channel not found' });
|
||||
|
||||
const ai = require('../services/ai');
|
||||
@@ -69,7 +69,7 @@ router.post('/post-image', async (req, res) => {
|
||||
const userId = parseInt(req.headers['x-user-id']) || null;
|
||||
if (!channelId || !post) return res.status(400).json({ error: 'channelId and post required' });
|
||||
|
||||
const channel = await channelsSvc.getChannel(userId, channelId);
|
||||
const channel = await channelsSvc.getChannel(channelId, userId);
|
||||
if (!channel) return res.status(404).json({ error: 'Channel not found' });
|
||||
|
||||
const { generatePostImage } = require('../services/postImages');
|
||||
@@ -99,7 +99,7 @@ router.post('/topics-ideas', async (req, res) => {
|
||||
const { channelId, count = 7 } = req.body;
|
||||
const userId = parseInt(req.headers['x-user-id']) || null;
|
||||
if (!channelId) return res.status(400).json({ error: 'channelId required' });
|
||||
const channel = await channelsSvc.getChannel(userId, channelId);
|
||||
const channel = await channelsSvc.getChannel(channelId, userId);
|
||||
if (!channel) return res.status(404).json({ error: 'Channel not found' });
|
||||
|
||||
const ai = require('../services/ai');
|
||||
@@ -118,7 +118,7 @@ router.post('/from-url', async (req, res) => {
|
||||
const userId = parseInt(req.headers['x-user-id']) || null;
|
||||
if (!channelId || !url) return res.status(400).json({ error: 'channelId and url required' });
|
||||
|
||||
const channel = await channelsSvc.getChannel(userId, channelId);
|
||||
const channel = await channelsSvc.getChannel(channelId, userId);
|
||||
if (!channel) return res.status(404).json({ error: 'Channel not found' });
|
||||
|
||||
const { generateFromUrl } = require('../services/fromUrl');
|
||||
|
||||
Reference in New Issue
Block a user