-
Notifications
You must be signed in to change notification settings - Fork 1
π΄ 2. Frontend: Inconsistent Session HandlingΒ #156
Copy link
Copy link
Closed
Description
Location: templates/add_area.html:418
async function fetchIssueData(issueId){
let response = await fetch(`api/gitea/get-issue/${issueId}`) // β Wrong
let issue = await response.json()
return issue.data
}Problem: Uses fetch() instead of apiFetch() wrapper. All other API calls in this file use apiFetch() which handles session expiration properly.
Fix:
async function fetchIssueData(issueId){
try {
let response = await apiFetch(`/api/gitea/get-issue/${issueId}`) // β
Use apiFetch
let result = await response.json()
if (!response.ok || result.error) {
throw new Error(result.error || 'Failed to fetch issue data')
}
return result.data
} catch (error) {
if (error.message === 'Session expired') throw error;
showToast('Error', `Failed to load issue #${issueId}: ${error.message}`, 'error')
throw error
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels