Arjit commited on
Commit
60700cc
·
1 Parent(s): 9645143

Fix TypeScript error: Add ai_image property to Slide interface

Browse files

- Added ai_image?: string to Slide interface to match backend response
- Fixed downloads.ts to use ai_image instead of non-existent visual_url
- This resolves the production build TypeScript error

Files changed (2) hide show
  1. lib/downloads.ts +2 -2
  2. types/index.ts +1 -0
lib/downloads.ts CHANGED
@@ -108,12 +108,12 @@ export const downloadAllSlides = async (
108
  ) => {
109
  for (let i = 0; i < slides.length; i++) {
110
  const slide = slides[i];
111
- if (slide.visual_url) {
112
  // Add delay between downloads to avoid browser blocking
113
  if (i > 0) {
114
  await new Promise(resolve => setTimeout(resolve, 200));
115
  }
116
- downloadSlideImage(slide.visual_url, slide.title, slide.id, documentId);
117
  }
118
  }
119
  };
 
108
  ) => {
109
  for (let i = 0; i < slides.length; i++) {
110
  const slide = slides[i];
111
+ if (slide.ai_image) {
112
  // Add delay between downloads to avoid browser blocking
113
  if (i > 0) {
114
  await new Promise(resolve => setTimeout(resolve, 200));
115
  }
116
+ downloadSlideImage(slide.ai_image, slide.title, slide.id, documentId);
117
  }
118
  }
119
  };
types/index.ts CHANGED
@@ -21,6 +21,7 @@ export interface Slide {
21
  type: 'title' | 'content' | 'chart' | 'stats';
22
  visual_type?: 'none' | 'bar_chart' | 'pie_chart' | 'stats_grid' | 'icon_grid';
23
  visual_data?: any;
 
24
  }
25
 
26
  export interface DebatePoint {
 
21
  type: 'title' | 'content' | 'chart' | 'stats';
22
  visual_type?: 'none' | 'bar_chart' | 'pie_chart' | 'stats_grid' | 'icon_grid';
23
  visual_data?: any;
24
+ ai_image?: string;
25
  }
26
 
27
  export interface DebatePoint {