diff --git a/app/pages/productions/[...slug].vue b/app/pages/productions/[...slug].vue index 64c337c..557d450 100644 --- a/app/pages/productions/[...slug].vue +++ b/app/pages/productions/[...slug].vue @@ -97,7 +97,6 @@ onMounted(async () => { populate: '*', locale: strapiLocale, }) - if (response.data) { const item = response.data production.value = { @@ -108,7 +107,7 @@ onMounted(async () => { production_specs: item.production_specs, production_image: item.production_image, documentId: item.documentId, - } + documents: item.documents || [] } } } catch (error) { console.error('Failed to fetch production:', error) diff --git a/app/types/strapi/common.ts b/app/types/strapi/common.ts index ef5fb21..a6c1c52 100644 --- a/app/types/strapi/common.ts +++ b/app/types/strapi/common.ts @@ -7,18 +7,13 @@ export interface StrapiEntity { locale?: string; } -export interface StrapiImage { +export interface StrapiMedia { id: number; url: string; + ext?: string; + name?: string; alternativeText?: string; caption?: string; - width?: number; - height?: number; - formats?: { - small?: StrapiImageFormat; - medium?: StrapiImageFormat; - thumbnail?: StrapiImageFormat; - } } export interface StrapiImageFormat { @@ -28,6 +23,16 @@ export interface StrapiImageFormat { size: number; } +export interface StrapiImage extends StrapiMedia { + width?: number; + height?: number; + formats?: { + small?: StrapiImageFormat; + medium?: StrapiImageFormat; + thumbnail?: StrapiImageFormat; + } +} + export interface StrapiResponse { data: T; meta?: { diff --git a/app/types/strapi/production.ts b/app/types/strapi/production.ts index ac84b18..b5dcc0e 100644 --- a/app/types/strapi/production.ts +++ b/app/types/strapi/production.ts @@ -1,4 +1,4 @@ -import type { StrapiEntity, StrapiImage } from './common'; +import type { StrapiEntity, StrapiImage, StrapiMedia } from './common'; export interface ProductionType extends StrapiEntity { type: string; @@ -11,4 +11,5 @@ export interface Production extends StrapiEntity { production_image?: StrapiImage; production_details?: string; production_specs?: string | object; + documents?: StrapiMedia[]; } \ No newline at end of file