refactor(production): 重构产品页代码
- 将Production的documents类型改写为单独的interface:ProductionDocument
This commit is contained in:
@ -44,4 +44,6 @@ export interface StrapiResponse<T> {
|
||||
total: number;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type StrapiRelation<T, K extends keyof T = never> = Omit<T, K | keyof StrapiEntity> & StrapiEntity;
|
||||
@ -1,4 +1,4 @@
|
||||
import type { StrapiEntity, StrapiImage, StrapiMedia } from './common';
|
||||
import type { StrapiEntity, StrapiImage, StrapiMedia, StrapiRelation } from './common';
|
||||
|
||||
export interface ProductionType extends StrapiEntity {
|
||||
type: string;
|
||||
@ -22,7 +22,12 @@ export interface Production extends StrapiEntity {
|
||||
production_images: StrapiImage[];
|
||||
production_details: string;
|
||||
production_specs: ProductionSpecGroup[];
|
||||
questions: Question[];
|
||||
documents: StrapiMedia[];
|
||||
production_documents: StrapiRelation<ProductionDocument, 'related_productions'>[];
|
||||
questions: StrapiRelation<Question, 'related_productions'>[];
|
||||
show_in_production_list: boolean;
|
||||
}
|
||||
|
||||
export interface ProductionDocument extends StrapiEntity {
|
||||
document: StrapiMedia;
|
||||
related_productions: StrapiRelation<Production, 'production_documents'>[];
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
export interface Question extends StrapiEntity {
|
||||
title: string;
|
||||
content: string;
|
||||
related_productions: StrapiRelation<Production, 'questions'>[];
|
||||
}
|
||||
Reference in New Issue
Block a user