chore: bulk commit of local changes across blog writer, SEO dashboard, scheduler, docs-site, and frontend
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import React, { useState, useMemo, useEffect } from 'react';
|
||||
import { useSearchParams, useNavigate } from 'react-router-dom';
|
||||
import { getApiBaseUrl } from '../../utils/apiUrl';
|
||||
import {
|
||||
Box,
|
||||
Paper,
|
||||
@@ -48,6 +49,8 @@ import { AssetFilters as AssetFiltersComponent } from './AssetLibraryComponents/
|
||||
import { AssetCard } from './AssetLibraryComponents/AssetCard';
|
||||
import { AssetTableRow } from './AssetLibraryComponents/AssetTableRow';
|
||||
|
||||
const API_BASE_URL = getApiBaseUrl();
|
||||
|
||||
export const AssetLibrary: React.FC = () => {
|
||||
const [searchParams] = useSearchParams();
|
||||
const navigate = useNavigate();
|
||||
@@ -321,9 +324,10 @@ export const AssetLibrary: React.FC = () => {
|
||||
headers['Authorization'] = `Bearer ${token}`;
|
||||
}
|
||||
|
||||
const response = await fetch(asset.file_url, { headers });
|
||||
const response = await fetch(`${API_BASE_URL}/api/content-assets/${asset.id}/content`, { headers });
|
||||
if (response.ok) {
|
||||
const content = await response.text();
|
||||
const data = await response.json();
|
||||
const content = data.content || '';
|
||||
setTextPreviews(prev => ({ ...prev, [asset.id]: { content, loading: false, expanded: false } }));
|
||||
} else {
|
||||
throw new Error('Failed to fetch text content');
|
||||
|
||||
Reference in New Issue
Block a user