sozsoft-platform/ui/src/services/home.service.ts

151 lines
3.4 KiB
TypeScript
Raw Normal View History

import apiService from './api.service'
export interface HomeSlideServiceDto {
icon: string
titleKey: string
descriptionKey: string
2026-03-17 13:35:58 +00:00
styleClass?: string
}
export interface HomeSlideDto {
titleKey: string
subtitleKey: string
2026-03-17 13:35:58 +00:00
styleClass?: string
services: HomeSlideServiceDto[]
}
export interface HomeFeatureDto {
icon: string
titleKey: string
descriptionKey: string
2026-03-17 13:35:58 +00:00
styleClass?: string
}
export interface HomeSolutionDto {
icon: string
colorClass: string
titleKey: string
descriptionKey: string
2026-03-17 13:35:58 +00:00
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
2026-03-17 13:35:58 +00:00
styleClass: string
}
export interface SaveHomeSlideInput {
titleKey: string
titleValue: string
subtitleKey: string
subtitleValue: string
2026-03-17 13:35:58 +00:00
styleClass: string
services: SaveHomeSlideServiceInput[]
}
export interface SaveHomeFeatureInput {
icon: string
titleKey: string
titleValue: string
descriptionKey: string
descriptionValue: string
2026-03-17 13:35:58 +00:00
styleClass: string
}
export interface SaveHomeSolutionInput {
icon: string
colorClass: string
titleKey: string
titleValue: string
descriptionKey: string
descriptionValue: string
2026-03-17 13:35:58 +00:00
styleClass: string
}
export interface SaveHomePageInput {
cultureName: string
heroBackgroundImageKey: string
heroBackgroundImageValue: string
heroPrimaryCtaKey: string
heroPrimaryCtaValue: string
2026-03-17 13:35:58 +00:00
heroPrimaryCtaStyleKey: string
heroPrimaryCtaStyleValue: string
heroSecondaryCtaKey: string
heroSecondaryCtaValue: string
2026-03-17 13:35:58 +00:00
heroSecondaryCtaStyleKey: string
heroSecondaryCtaStyleValue: string
featuresTitleKey: string
featuresTitleValue: string
2026-03-17 13:35:58 +00:00
featuresTitleStyleKey: string
featuresTitleStyleValue: string
featuresSubtitleKey: string
featuresSubtitleValue: string
2026-03-17 13:35:58 +00:00
featuresSubtitleStyleKey: string
featuresSubtitleStyleValue: string
solutionsTitleKey: string
solutionsTitleValue: string
2026-03-17 13:35:58 +00:00
solutionsTitleStyleKey: string
solutionsTitleStyleValue: string
solutionsSubtitleKey: string
solutionsSubtitleValue: string
2026-03-17 13:35:58 +00:00
solutionsSubtitleStyleKey: string
solutionsSubtitleStyleValue: string
ctaTitleKey: string
ctaTitleValue: string
2026-03-17 13:35:58 +00:00
ctaTitleStyleKey: string
ctaTitleStyleValue: string
ctaSubtitleKey: string
ctaSubtitleValue: string
2026-03-17 13:35:58 +00:00
ctaSubtitleStyleKey: string
ctaSubtitleStyleValue: string
ctaButtonLabelKey: string
ctaButtonLabelValue: string
2026-03-17 13:35:58 +00:00
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' },
)
}