150 lines
3.4 KiB
TypeScript
150 lines
3.4 KiB
TypeScript
import apiService from './api.service'
|
|
|
|
export interface HomeSlideServiceDto {
|
|
icon: string
|
|
titleKey: string
|
|
descriptionKey: string
|
|
styleClass?: string
|
|
}
|
|
|
|
export interface HomeSlideDto {
|
|
titleKey: string
|
|
subtitleKey: string
|
|
styleClass?: string
|
|
services: HomeSlideServiceDto[]
|
|
}
|
|
|
|
export interface HomeFeatureDto {
|
|
icon: string
|
|
titleKey: string
|
|
descriptionKey: string
|
|
styleClass?: string
|
|
}
|
|
|
|
export interface HomeSolutionDto {
|
|
icon: string
|
|
colorClass: string
|
|
titleKey: string
|
|
descriptionKey: string
|
|
styleClass?: string
|
|
}
|
|
|
|
export interface HomeDto {
|
|
id: string
|
|
heroBackgroundImageKey: string
|
|
heroPrimaryCtaKey: string
|
|
heroSecondaryCtaKey: string
|
|
featuresTitleKey: string
|
|
featuresSubtitleKey: string
|
|
solutionsTitleKey: string
|
|
solutionsSubtitleKey: string
|
|
ctaTitleKey: string
|
|
ctaSubtitleKey: string
|
|
ctaButtonLabelKey: string
|
|
slidesDto: HomeSlideDto[]
|
|
featuresDto: HomeFeatureDto[]
|
|
solutionsDto: HomeSolutionDto[]
|
|
}
|
|
|
|
export interface SaveHomeSlideServiceInput {
|
|
icon: string
|
|
titleKey: string
|
|
titleValue: string
|
|
descriptionKey: string
|
|
descriptionValue: string
|
|
styleClass: string
|
|
}
|
|
|
|
export interface SaveHomeSlideInput {
|
|
titleKey: string
|
|
titleValue: string
|
|
subtitleKey: string
|
|
subtitleValue: string
|
|
styleClass: string
|
|
services: SaveHomeSlideServiceInput[]
|
|
}
|
|
|
|
export interface SaveHomeFeatureInput {
|
|
icon: string
|
|
titleKey: string
|
|
titleValue: string
|
|
descriptionKey: string
|
|
descriptionValue: string
|
|
styleClass: string
|
|
}
|
|
|
|
export interface SaveHomeSolutionInput {
|
|
icon: string
|
|
colorClass: string
|
|
titleKey: string
|
|
titleValue: string
|
|
descriptionKey: string
|
|
descriptionValue: string
|
|
styleClass: string
|
|
}
|
|
|
|
export interface SaveHomePageInput {
|
|
cultureName: string
|
|
heroBackgroundImageKey: string
|
|
heroBackgroundImageValue: string
|
|
heroPrimaryCtaKey: string
|
|
heroPrimaryCtaValue: string
|
|
heroPrimaryCtaStyleKey: string
|
|
heroPrimaryCtaStyleValue: string
|
|
heroSecondaryCtaKey: string
|
|
heroSecondaryCtaValue: string
|
|
heroSecondaryCtaStyleKey: string
|
|
heroSecondaryCtaStyleValue: string
|
|
featuresTitleKey: string
|
|
featuresTitleValue: string
|
|
featuresTitleStyleKey: string
|
|
featuresTitleStyleValue: string
|
|
featuresSubtitleKey: string
|
|
featuresSubtitleValue: string
|
|
featuresSubtitleStyleKey: string
|
|
featuresSubtitleStyleValue: string
|
|
solutionsTitleKey: string
|
|
solutionsTitleValue: string
|
|
solutionsTitleStyleKey: string
|
|
solutionsTitleStyleValue: string
|
|
solutionsSubtitleKey: string
|
|
solutionsSubtitleValue: string
|
|
solutionsSubtitleStyleKey: string
|
|
solutionsSubtitleStyleValue: string
|
|
ctaTitleKey: string
|
|
ctaTitleValue: string
|
|
ctaTitleStyleKey: string
|
|
ctaTitleStyleValue: string
|
|
ctaSubtitleKey: string
|
|
ctaSubtitleValue: string
|
|
ctaSubtitleStyleKey: string
|
|
ctaSubtitleStyleValue: string
|
|
ctaButtonLabelKey: string
|
|
ctaButtonLabelValue: string
|
|
ctaButtonStyleKey: string
|
|
ctaButtonStyleValue: string
|
|
slides: SaveHomeSlideInput[]
|
|
features: SaveHomeFeatureInput[]
|
|
solutions: SaveHomeSolutionInput[]
|
|
}
|
|
|
|
export function getHome() {
|
|
return apiService.fetchData<HomeDto>(
|
|
{
|
|
method: 'GET',
|
|
url: '/api/app/public/home',
|
|
},
|
|
{ apiName: 'Default' },
|
|
)
|
|
}
|
|
|
|
export function saveHomePage(input: SaveHomePageInput) {
|
|
return apiService.fetchData<void, SaveHomePageInput>(
|
|
{
|
|
method: 'POST',
|
|
url: '/api/app/public/save-home-page',
|
|
data: input,
|
|
},
|
|
{ apiName: 'Default' },
|
|
)
|
|
}
|