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