fix: show backstage films on all content sources, not just IndeeHub API
The filmmakerService.usesSelfHosted() was tied to the content source toggle, returning true only for 'indeehub-api'. When the user switched to 'topdocfilms' or 'indeehub', the mergePublishedFilmmakerProjects() function routed filmmaker API calls to the wrong (external) API, so backstage-created films never appeared. Now in production (USE_MOCK=false), filmmaker operations always use the self-hosted backend regardless of which content catalog is active. The content source toggle only affects the browse page catalog display. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -20,7 +20,7 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
args:
|
args:
|
||||||
CACHEBUST: "15"
|
CACHEBUST: "16"
|
||||||
VITE_USE_MOCK_DATA: "false"
|
VITE_USE_MOCK_DATA: "false"
|
||||||
VITE_CONTENT_ORIGIN: ${FRONTEND_URL}
|
VITE_CONTENT_ORIGIN: ${FRONTEND_URL}
|
||||||
VITE_INDEEHUB_API_URL: /api
|
VITE_INDEEHUB_API_URL: /api
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
import { apiService } from './api.service'
|
import { apiService } from './api.service'
|
||||||
import { indeehubApiService } from './indeehub-api.service'
|
import { indeehubApiService } from './indeehub-api.service'
|
||||||
import { useContentSourceStore } from '../stores/contentSource'
|
import { useContentSourceStore } from '../stores/contentSource'
|
||||||
|
import { USE_MOCK } from '../utils/mock'
|
||||||
import type {
|
import type {
|
||||||
ApiProject,
|
ApiProject,
|
||||||
ApiContent,
|
ApiContent,
|
||||||
@@ -26,9 +27,16 @@ import type {
|
|||||||
} from '../types/api'
|
} from '../types/api'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if we should route requests to our self-hosted backend
|
* Check if we should route requests to our self-hosted backend.
|
||||||
|
*
|
||||||
|
* In production (USE_MOCK = false) the self-hosted API is always
|
||||||
|
* available, so filmmaker operations always use it regardless of
|
||||||
|
* which content catalog is active on the browse page.
|
||||||
|
* In dev/mock mode, only route to self-hosted when the content
|
||||||
|
* source explicitly selects 'indeehub-api'.
|
||||||
*/
|
*/
|
||||||
function usesSelfHosted(): boolean {
|
function usesSelfHosted(): boolean {
|
||||||
|
if (!USE_MOCK) return true
|
||||||
const store = useContentSourceStore()
|
const store = useContentSourceStore()
|
||||||
return store.activeSource === 'indeehub-api'
|
return store.activeSource === 'indeehub-api'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user