frontend changes
This commit is contained in:
parent
983624b12d
commit
f87b6a864f
@ -17,9 +17,11 @@ export async function analyzeFeatureWithAI(
|
||||
try {
|
||||
// Prefer dedicated analysis endpoint if available in requirements service
|
||||
const primaryUrl = `${BACKEND_URL}/api/requirements/analyze-feature`
|
||||
const accessToken = (typeof window !== 'undefined') ? localStorage.getItem('accessToken') : null
|
||||
const authHeaders = accessToken ? { Authorization: `Bearer ${accessToken}` } : {}
|
||||
let res = await fetch(primaryUrl, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
headers: { 'Content-Type': 'application/json', ...authHeaders },
|
||||
body: JSON.stringify({ featureName, description, requirements, projectType, complexity: userSelectedComplexity }),
|
||||
})
|
||||
|
||||
@ -28,7 +30,7 @@ export async function analyzeFeatureWithAI(
|
||||
const fallbackUrl = `${BACKEND_URL}/api/mockup/generate-wireframe`
|
||||
res = await fetch(fallbackUrl, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
headers: { 'Content-Type': 'application/json', ...authHeaders },
|
||||
body: JSON.stringify({
|
||||
prompt: `${featureName}: ${description}. Requirements: ${requirements.join('; ')}`,
|
||||
device: 'desktop',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user