Add PUT endpoint and in-place title editing for stories

This commit is contained in:
Riccardo Giorato
2025-12-27 20:10:26 +01:00
parent 708205f3f0
commit 849aec93dd
3 changed files with 152 additions and 4 deletions
@@ -65,6 +65,10 @@ export function StoryEditorClient() {
const { toast } = useToast();
const [apiKey, setApiKey] = useApiKey();
const handleTitleUpdate = (newTitle: string) => {
setStory(prev => prev ? { ...prev, title: newTitle } : null);
};
// Load story and pages from API
useEffect(() => {
const loadStoryData = async () => {
@@ -423,6 +427,7 @@ export function StoryEditorClient() {
onDownloadPDF={downloadPDF}
isGeneratingPDF={isGeneratingPDF}
isOwner={isOwner}
onTitleUpdate={handleTitleUpdate}
/>
<div className="flex-1 flex overflow-hidden">