WEB: INTERFACE AND AUTH FAILS TO DELETE
Local Docker Build (Dev) / build-dev (push) Successful in 5s
Local Docker Build (Dev) / build-dev (push) Successful in 5s
This commit is contained in:
@@ -92,6 +92,7 @@ function initializeEventListeners() {
|
||||
async function apiCall(endpoint, options = {}) {
|
||||
try {
|
||||
const response = await fetch(endpoint, {
|
||||
credentials: 'include', // Include cookies for authentication
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...options.headers
|
||||
@@ -912,7 +913,7 @@ function showEnhancedEditModal(mediaType, options, currentDateadded, currentSour
|
||||
`;
|
||||
|
||||
// Add available date options
|
||||
options.options.forEach((option, index) => {
|
||||
(options.date_options || options.options || []).forEach((option, index) => {
|
||||
const isSelected = option.source === currentSource ? 'checked' : '';
|
||||
const optionId = `date-option-${index}`;
|
||||
|
||||
@@ -1086,7 +1087,14 @@ async function editEpisode(imdbId, season, episode, dateadded, source) {
|
||||
|
||||
try {
|
||||
// Load episode options to populate available dates
|
||||
const options = await apiCall(`/api/episodes/${imdbId}/${season}/${episode}/date-options`);
|
||||
const dateOptions = await apiCall(`/api/episodes/${imdbId}/${season}/${episode}/date-options`);
|
||||
// Create options object with episode metadata
|
||||
const options = {
|
||||
imdb_id: imdbId,
|
||||
season: season,
|
||||
episode: episode,
|
||||
date_options: dateOptions.options || []
|
||||
};
|
||||
showEnhancedEditModal('episode', options, dateadded, source);
|
||||
} catch (error) {
|
||||
console.error('Failed to load episode options for edit:', error);
|
||||
|
||||
Reference in New Issue
Block a user