add services page

This commit is contained in:
Schneider Roland 2025-01-27 22:09:49 +01:00
parent 129e796852
commit ceac176558
12 changed files with 523 additions and 11 deletions

View File

@ -13,7 +13,7 @@ Accept: application/json
#Authorization: Bearer {{token}}
### GET request with a header
GET {{domain}}/api/about?populate[header][fields][0]=header1&populate[header][fields][1]=description&populate[footer][fields][0]=*&populate[footer][populate][links][fields][0]=*&populate[footer][populate][contactUsEmail][fields][0]=*&populate[footer][populate][contactUsLocation][fields][0]=*&populate[footer][populate][contactUsPhoneNumber][fields][0]=*&populate[subscribeNow][fields][0]=*&populate[blogs][fields][0]=*&populate[blogs][populate][button][fields][0]=*&populate[blogs][populate][posts][fields][0]=name&populate[blogs][populate][posts][fields][1]=id&populate[blogs][populate][posts][fields][2]=header&populate[blogs][populate][posts][fields][3]=documentId&populate[blogs][populate][posts][populate][tags][fields][0]=*&populate[blogs][populate][posts][populate][teaserImage][fields][0]=name&populate[blogs][populate][posts][populate][teaserImage][fields][1]=mime&populate[blogs][populate][posts][populate][teaserImage][fields][2]=url&populate[feedbacks][fields][0]=*&populate[feedbacks][populate][feedbacks][fields][0]=*&populate[feedbacks][populate][feedbacks][populate][customerImage][fields][0]=name&populate[feedbacks][populate][feedbacks][populate][customerImage][fields][1]=mime&populate[feedbacks][populate][feedbacks][populate][customerImage][fields][2]=url&populate[ourServices][fields][0]=*&populate[ourServices][populate][services][fields][0]=*&populate[ourServices][populate][services][populate][image][fields][0]=name&populate[ourServices][populate][services][populate][image][fields][1]=mime&populate[ourServices][populate][services][populate][image][fields][2]=url&populate[aboutUs1][fields][0]=*&populate[aboutUs1][populate][image][fields][0]=name&populate[aboutUs1][populate][image][fields][1]=mime&populate[aboutUs1][populate][image][fields][2]=url&populate[contactUs][fields][0]=*&populate[prices][fields][0]=*&populate[prices][populate][prices][fields][0]=*&populate[prices][populate][prices][populate][icon][fields][0]=name&populate[prices][populate][prices][populate][icon][fields][1]=mime&populate[prices][populate][prices][populate][icon][fields][2]=url&populate[prices][populate][prices][populate][image][fields][0]=name&populate[prices][populate][prices][populate][image][fields][1]=mime&populate[prices][populate][prices][populate][image][fields][2]=url&populate[ourSpecialities][fields][0]=*&populate[ourSpecialities][populate][left1][fields][0]=*&populate[ourSpecialities][populate][left2][fields][0]=*&populate[ourSpecialities][populate][left3][fields][0]=*&populate[ourSpecialities][populate][left4][fields][0]=*&populate[ourSpecialities][populate][right1][fields][0]=*&populate[ourSpecialities][populate][right2][fields][0]=*&populate[ourSpecialities][populate][right3][fields][0]=*&populate[ourSpecialities][populate][right4][fields][0]=*
GET {{domain}}/api/about?api/services-page?
Accept: application/json
#Authorization: Bearer {{token}}

View File

@ -0,0 +1,102 @@
{
"fields": ["*"],
"populate": {
"ourServices": {
"fields": ["*"],
"populate": {
"services": {
"fields": ["*"],
"populate": {
"image": {
"fields": ["name","mime","url"]
}
}
}
}
},
"contactUs": {
"fields": ["*"]
},
"ourSpecialities": {
"fields": ["*"] ,
"populate": {
"left1": {
"fields": ["*"]
},
"left2": {
"fields": ["*"]
},
"left3": {
"fields": ["*"]
},
"left4": {
"fields": ["*"]
},
"right1": {
"fields": ["*"]
},
"right2": {
"fields": ["*"]
},
"right3": {
"fields": ["*"]
},
"right4": {
"fields": ["*"]
}
}
},
"feedbacks": {
"fields": ["*"],
"populate": {
"feedbacks": {
"fields": ["*"],
"populate": {
"customerImage": {
"fields": ["name","mime","url"]
}
}
}
}
},
"blogs": {
"fields": ["*"],
"populate": {
"button": {
"fields": ["*"]
},
"posts": {
"fields": ["name", "id", "header","documentId" ],
"populate": {
"tags": {
"fields": ["*" ]
},
"teaserImage": {
"fields": ["name","mime","url"]
}
}
}
}
},
"subscribe": {
"fields": ["*"]
},
"footer": {
"fields": ["*"],
"populate": {
"links": {
"fields": ["*"]
},
"contactUsEmail": {
"fields": ["*"]
},
"contactUsLocation": {
"fields": ["*"]
},
"contactUsPhoneNumber": {
"fields": ["*"]
}
}
}
}
}

View File

@ -0,0 +1,104 @@
{
"fields": ["*"],
"populate": {
"ourServices": {
"fields": ["*"],
"populate": {
"services": {
"fields": ["*"],
"populate": {
"image": {
"fields": ["name","mime","url"]
}
}
}
}
},
"contactUs": {
"fields": ["*"]
},
"ourSpecialities": {
"fields": ["*"] ,
"populate": {
"left1": {
"fields": ["*"]
},
"left2": {
"fields": ["*"]
},
"left3": {
"fields": ["*"]
},
"left4": {
"fields": ["*"]
},
"right1": {
"fields": ["*"]
},
"right2": {
"fields": ["*"]
},
"right3": {
"fields": ["*"]
},
"right4": {
"fields": ["*"]
}
}
},
"feedbacks": {
"fields": ["*"],
"populate": {
"feedbacks": {
"fields": ["*"],
"populate": {
"customerImage": {
"fields": ["name","mime","url"]
}
}
}
}
},
"blogs": {
"fields": ["*"],
"populate": {
"button": {
"fields": ["*"]
},
"posts": {
"fields": ["name", "id", "header","documentId" ],
"populate": {
"tags": {
"fields": ["*" ]
},
"teaserImage": {
"fields": ["name","mime","url"]
}
}
}
}
},
"subscribeNow": {
"fields": ["*"]
},
"footer": {
"fields": ["*"],
"populate": {
"links": {
"fields": ["*"]
},
"contactUsEmail": {
"fields": ["*"]
},
"contactUsLocation": {
"fields": ["*"]
},
"contactUsPhoneNumber": {
"fields": ["*"]
}
}
}
}
}

View File

@ -3,8 +3,10 @@ import strapiClient from "@/api/strapi/strapi-client";
import qs from "qs";
import aboutQuery from "@/api/strapi/query/about.json";
import homeQuery from "@/api/strapi/query/home.json";
import servicesQuery from "@/api/strapi/query/services.json";
import {YogaBlogPost_Plain} from "@/types/generated-strapi-interfaces/api/yoga-blog-post";
import {Home_Plain} from "@/types/generated-strapi-interfaces/api/home";
import {ServicesPage_Plain} from "@/types/generated-strapi-interfaces/api/services-page";
class StrapiApi{
@ -28,7 +30,10 @@ class StrapiApi{
public getHomePage(): Promise<Home_Plain>{
return this.getJson("/api/home?",homeQuery);
}
public getServicesPage(): Promise<ServicesPage_Plain>{
return this.getJson("/api/services-page?",servicesQuery);
}
public getBlog(blogId: string): Promise<YogaBlogPost_Plain>{

View File

@ -9,19 +9,31 @@ import FeedbackComponent from "@/components/feedbackComponent";
import BlogPostsComponent from "@/components/blog.posts.component";
import FooterComponent from "@/components/footer.component";
import SubscribeComponent from "@/components/subscribe.component";
import strapiApi from "@/api/strapi/strapi-api";
import SubHeaderComponent from "@/components/subHeader.component";
export default function About() {
export default async function Services() {
const {
header,
description,
ourServices,
contactUs,
ourSpecialities,
feedbacks,
blogs,
footer,
subscribe
} = await strapiApi.getServicesPage();
return (
<>
<OurServicesComponent />
<AboutUsComponent />
<OurSpecialitiesComponent />
<ContactUsComponent />
<PricingComponent />
<FeedbackComponent />
<BlogPostsComponent />
<SubscribeComponent />
<FooterComponent />
{header && description && <SubHeaderComponent header1={header} description={description} />}
{ ourServices && <OurServicesComponent header={ourServices.header!} title={ourServices.title!} description={ourServices.description!} /> }
{ contactUs && <ContactUsComponent contactUs={contactUs} />}
{ ourSpecialities && <OurSpecialitiesComponent config={ourSpecialities} /> }
{ feedbacks && <FeedbackComponent config={feedbacks} /> }
{ blogs && <BlogPostsComponent config={blogs} /> }
{ subscribe && <SubscribeComponent config={subscribe} /> }
{ footer && <FooterComponent config={footer} /> }
<AosComponent />
</>

View File

@ -0,0 +1,74 @@
// Interface automatically generated by schemas-to-ts
import { YogaOurServicesComponent } from './yoga-our-services-component';
import { YogaContactUs } from './yoga-contact-us';
import { YogaSpecialitiesComponent } from './yoga-specialities-component';
import { YogaCustomerFeedbackComponent } from './yoga-customer-feedback-component';
import { YogaBlogPostsComponent } from './yoga-blog-posts-component';
import { YogaSubscribeNowComponent } from './yoga-subscribe-now-component';
import { YogaFooter } from './yoga-footer';
import { YogaOurServicesComponent_Plain } from './yoga-our-services-component';
import { YogaContactUs_Plain } from './yoga-contact-us';
import { YogaSpecialitiesComponent_Plain } from './yoga-specialities-component';
import { YogaCustomerFeedbackComponent_Plain } from './yoga-customer-feedback-component';
import { YogaBlogPostsComponent_Plain } from './yoga-blog-posts-component';
import { YogaSubscribeNowComponent_Plain } from './yoga-subscribe-now-component';
import { YogaFooter_Plain } from './yoga-footer';
import { AdminPanelRelationPropertyModification } from '../common/AdminPanelRelationPropertyModification';
export interface ServicesPage {
id: number;
attributes: {
createdAt: Date; updatedAt: Date; publishedAt?: Date; header?: string;
description?: string;
ourServices?: { data: YogaOurServicesComponent };
contactUs?: { data: YogaContactUs };
ourSpecialities?: { data: YogaSpecialitiesComponent };
feedbacks?: { data: YogaCustomerFeedbackComponent };
blogs?: { data: YogaBlogPostsComponent };
subscribe?: { data: YogaSubscribeNowComponent };
footer?: { data: YogaFooter };
title?: string;
};
}
export interface ServicesPage_Plain {
id: number;
createdAt: Date; updatedAt: Date; publishedAt?: Date; header?: string;
description?: string;
ourServices?: YogaOurServicesComponent_Plain;
contactUs?: YogaContactUs_Plain;
ourSpecialities?: YogaSpecialitiesComponent_Plain;
feedbacks?: YogaCustomerFeedbackComponent_Plain;
blogs?: YogaBlogPostsComponent_Plain;
subscribe?: YogaSubscribeNowComponent_Plain;
footer?: YogaFooter_Plain;
title?: string;
}
export interface ServicesPage_NoRelations {
id: number;
createdAt: Date; updatedAt: Date; publishedAt?: Date; header?: string;
description?: string;
ourServices?: number;
contactUs?: number;
ourSpecialities?: number;
feedbacks?: number;
blogs?: number;
subscribe?: number;
footer?: number;
title?: string;
}
export interface ServicesPage_AdminPanelLifeCycle {
id: number;
createdAt: Date; updatedAt: Date; publishedAt?: Date; header?: string;
description?: string;
ourServices?: AdminPanelRelationPropertyModification<YogaOurServicesComponent_Plain>;
contactUs?: AdminPanelRelationPropertyModification<YogaContactUs_Plain>;
ourSpecialities?: AdminPanelRelationPropertyModification<YogaSpecialitiesComponent_Plain>;
feedbacks?: AdminPanelRelationPropertyModification<YogaCustomerFeedbackComponent_Plain>;
blogs?: AdminPanelRelationPropertyModification<YogaBlogPostsComponent_Plain>;
subscribe?: AdminPanelRelationPropertyModification<YogaSubscribeNowComponent_Plain>;
footer?: AdminPanelRelationPropertyModification<YogaFooter_Plain>;
title?: string;
}

View File

@ -0,0 +1,74 @@
// Interface automatically generated by schemas-to-ts
import { YogaOurServicesComponent } from './yoga-our-services-component';
import { YogaContactUs } from './yoga-contact-us';
import { YogaSpecialitiesComponent } from './yoga-specialities-component';
import { YogaCustomerFeedbackComponent } from './yoga-customer-feedback-component';
import { YogaBlogPostsComponent } from './yoga-blog-posts-component';
import { YogaSubscribeNowComponent } from './yoga-subscribe-now-component';
import { YogaFooter } from './yoga-footer';
import { YogaOurServicesComponent_Plain } from './yoga-our-services-component';
import { YogaContactUs_Plain } from './yoga-contact-us';
import { YogaSpecialitiesComponent_Plain } from './yoga-specialities-component';
import { YogaCustomerFeedbackComponent_Plain } from './yoga-customer-feedback-component';
import { YogaBlogPostsComponent_Plain } from './yoga-blog-posts-component';
import { YogaSubscribeNowComponent_Plain } from './yoga-subscribe-now-component';
import { YogaFooter_Plain } from './yoga-footer';
import { AdminPanelRelationPropertyModification } from '../common/AdminPanelRelationPropertyModification';
export interface ServicesPage {
id: number;
attributes: {
createdAt: Date; updatedAt: Date; publishedAt?: Date; header?: string;
description?: string;
ourServices?: { data: YogaOurServicesComponent };
contactUs?: { data: YogaContactUs };
ourSpecialities?: { data: YogaSpecialitiesComponent };
feedbacks?: { data: YogaCustomerFeedbackComponent };
blogs?: { data: YogaBlogPostsComponent };
subscribe?: { data: YogaSubscribeNowComponent };
footer?: { data: YogaFooter };
title?: string;
};
}
export interface ServicesPage_Plain {
id: number;
createdAt: Date; updatedAt: Date; publishedAt?: Date; header?: string;
description?: string;
ourServices?: YogaOurServicesComponent_Plain;
contactUs?: YogaContactUs_Plain;
ourSpecialities?: YogaSpecialitiesComponent_Plain;
feedbacks?: YogaCustomerFeedbackComponent_Plain;
blogs?: YogaBlogPostsComponent_Plain;
subscribe?: YogaSubscribeNowComponent_Plain;
footer?: YogaFooter_Plain;
title?: string;
}
export interface ServicesPage_NoRelations {
id: number;
createdAt: Date; updatedAt: Date; publishedAt?: Date; header?: string;
description?: string;
ourServices?: number;
contactUs?: number;
ourSpecialities?: number;
feedbacks?: number;
blogs?: number;
subscribe?: number;
footer?: number;
title?: string;
}
export interface ServicesPage_AdminPanelLifeCycle {
id: number;
createdAt: Date; updatedAt: Date; publishedAt?: Date; header?: string;
description?: string;
ourServices?: AdminPanelRelationPropertyModification<YogaOurServicesComponent_Plain>;
contactUs?: AdminPanelRelationPropertyModification<YogaContactUs_Plain>;
ourSpecialities?: AdminPanelRelationPropertyModification<YogaSpecialitiesComponent_Plain>;
feedbacks?: AdminPanelRelationPropertyModification<YogaCustomerFeedbackComponent_Plain>;
blogs?: AdminPanelRelationPropertyModification<YogaBlogPostsComponent_Plain>;
subscribe?: AdminPanelRelationPropertyModification<YogaSubscribeNowComponent_Plain>;
footer?: AdminPanelRelationPropertyModification<YogaFooter_Plain>;
title?: string;
}

View File

@ -0,0 +1,60 @@
{
"kind": "singleType",
"collectionName": "services_pages",
"info": {
"singularName": "services-page",
"pluralName": "services-pages",
"displayName": "Services",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"header": {
"type": "string"
},
"description": {
"type": "text"
},
"ourServices": {
"type": "relation",
"relation": "oneToOne",
"target": "api::yoga-our-services-component.yoga-our-services-component"
},
"contactUs": {
"type": "relation",
"relation": "oneToOne",
"target": "api::yoga-contact-us.yoga-contact-us"
},
"ourSpecialities": {
"type": "relation",
"relation": "oneToOne",
"target": "api::yoga-specialities-component.yoga-specialities-component"
},
"feedbacks": {
"type": "relation",
"relation": "oneToOne",
"target": "api::yoga-customer-feedback-component.yoga-customer-feedback-component"
},
"blogs": {
"type": "relation",
"relation": "oneToOne",
"target": "api::yoga-blog-posts-component.yoga-blog-posts-component"
},
"subscribe": {
"type": "relation",
"relation": "oneToOne",
"target": "api::yoga-subscribe-now-component.yoga-subscribe-now-component"
},
"footer": {
"type": "relation",
"relation": "oneToOne",
"target": "api::yoga-footer.yoga-footer"
},
"title": {
"type": "string"
}
}
}

View File

@ -0,0 +1,7 @@
/**
* services-page controller
*/
import { factories } from '@strapi/strapi'
export default factories.createCoreController('api::services-page.services-page');

View File

@ -0,0 +1,7 @@
/**
* services-page router
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::services-page.services-page');

View File

@ -0,0 +1,7 @@
/**
* services-page service
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreService('api::services-page.services-page');

View File

@ -700,6 +700,65 @@ export interface ApiPersonPerson extends Struct.SingleTypeSchema {
};
}
export interface ApiServicesPageServicesPage extends Struct.SingleTypeSchema {
collectionName: 'services_pages';
info: {
description: '';
displayName: 'Services';
pluralName: 'services-pages';
singularName: 'services-page';
};
options: {
draftAndPublish: true;
};
attributes: {
blogs: Schema.Attribute.Relation<
'oneToOne',
'api::yoga-blog-posts-component.yoga-blog-posts-component'
>;
contactUs: Schema.Attribute.Relation<
'oneToOne',
'api::yoga-contact-us.yoga-contact-us'
>;
createdAt: Schema.Attribute.DateTime;
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
Schema.Attribute.Private;
description: Schema.Attribute.Text;
feedbacks: Schema.Attribute.Relation<
'oneToOne',
'api::yoga-customer-feedback-component.yoga-customer-feedback-component'
>;
footer: Schema.Attribute.Relation<
'oneToOne',
'api::yoga-footer.yoga-footer'
>;
header: Schema.Attribute.String;
locale: Schema.Attribute.String & Schema.Attribute.Private;
localizations: Schema.Attribute.Relation<
'oneToMany',
'api::services-page.services-page'
> &
Schema.Attribute.Private;
ourServices: Schema.Attribute.Relation<
'oneToOne',
'api::yoga-our-services-component.yoga-our-services-component'
>;
ourSpecialities: Schema.Attribute.Relation<
'oneToOne',
'api::yoga-specialities-component.yoga-specialities-component'
>;
publishedAt: Schema.Attribute.DateTime;
subscribe: Schema.Attribute.Relation<
'oneToOne',
'api::yoga-subscribe-now-component.yoga-subscribe-now-component'
>;
title: Schema.Attribute.String;
updatedAt: Schema.Attribute.DateTime;
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
Schema.Attribute.Private;
};
}
export interface ApiYogaAboutUsComponentYogaAboutUsComponent
extends Struct.CollectionTypeSchema {
collectionName: 'yoga_about_us_components';
@ -2193,6 +2252,7 @@ declare module '@strapi/strapi' {
'api::home.home': ApiHomeHome;
'api::page.page': ApiPagePage;
'api::person.person': ApiPersonPerson;
'api::services-page.services-page': ApiServicesPageServicesPage;
'api::yoga-about-us-component.yoga-about-us-component': ApiYogaAboutUsComponentYogaAboutUsComponent;
'api::yoga-about-us-with-boxes-component.yoga-about-us-with-boxes-component': ApiYogaAboutUsWithBoxesComponentYogaAboutUsWithBoxesComponent;
'api::yoga-achivement.yoga-achivement': ApiYogaAchivementYogaAchivement;