backend changes
This commit is contained in:
parent
f829c771ca
commit
53af324e06
@ -355,11 +355,10 @@ app.use('/api/self-improving',
|
||||
console.log('🔧 Registering /api/features proxy route...');
|
||||
app.use('/api/features',
|
||||
createServiceLimiter(300),
|
||||
// Public proxy: features endpoints do not require auth
|
||||
(req, res, next) => {
|
||||
if (req.method === 'GET') {
|
||||
return next();
|
||||
}
|
||||
return authMiddleware.verifyToken(req, res, () => authMiddleware.forwardUserContext(req, res, next));
|
||||
console.log(`🟢 [FEATURES PROXY] Public access → ${req.method} ${req.originalUrl}`);
|
||||
return next();
|
||||
},
|
||||
(req, res, next) => {
|
||||
const templateServiceUrl = serviceTargets.TEMPLATE_MANAGER_URL;
|
||||
|
||||
@ -5,6 +5,7 @@ class CustomFeature {
|
||||
constructor(data = {}) {
|
||||
this.id = data.id;
|
||||
this.template_id = data.template_id;
|
||||
this.template_type = data.template_type || 'default';
|
||||
this.name = data.name;
|
||||
this.description = data.description;
|
||||
this.complexity = data.complexity;
|
||||
@ -43,7 +44,7 @@ class CustomFeature {
|
||||
const id = uuidv4();
|
||||
const query = `
|
||||
INSERT INTO custom_features (
|
||||
id, template_id, name, description, complexity,
|
||||
id, template_id, template_type, name, description, complexity,
|
||||
business_rules, technical_requirements, approved, usage_count, created_by_user_session,
|
||||
status, admin_notes, admin_reviewed_at, admin_reviewed_by, canonical_feature_id, similarity_score
|
||||
) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16)
|
||||
@ -52,6 +53,7 @@ class CustomFeature {
|
||||
const values = [
|
||||
id,
|
||||
data.template_id,
|
||||
data.template_type || 'default',
|
||||
data.name,
|
||||
data.description || null,
|
||||
data.complexity,
|
||||
|
||||
@ -487,6 +487,7 @@ router.post('/custom', async (req, res) => {
|
||||
|
||||
const created = await CustomFeature.create({
|
||||
template_id: data.template_id,
|
||||
template_type: templateCheck.rows[0]?.template_type === 'custom' ? 'custom' : 'default',
|
||||
name: data.name,
|
||||
description: data.description,
|
||||
complexity: data.complexity,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user