convert about types from component to collection-type

This commit is contained in:
Schneider Roland
2025-01-19 21:57:33 +01:00
parent 741dd19588
commit c706a4c7d2
80 changed files with 2428 additions and 630 deletions

View File

@@ -0,0 +1,89 @@
{
"populate": {
"header": {
"fields": ["header1","description"]
},
"feedbacks": {
"fields": ["*"],
"populate": {
"feedbacks": {
"fields": ["*"],
"populate": {
"customerImage": {
"fields": ["name","mime","url"]
}
}
}
}
},
"ourServices": {
"fields": ["*"],
"populate": {
"services": {
"fields": ["*"],
"populate": {
"image": {
"fields": ["name","mime","url"]
}
}
}
}
},
"aboutUs": {
"fields": ["*"],
"populate": {
"image": {
"fields": ["name","mime","url"]
}
}
},
"contactUs": {
"fields": ["*"]
},
"prices": {
"fields": ["*"],
"populate": {
"prices": {
"fields": ["*"],
"populate": {
"icon": {
"fields": ["name","mime","url"]
},
"image": {
"fields": ["name","mime","url"]
}
}
}
}
},
"ourSpecialities": {
"fields": ["*"] ,
"populate": {
"left1": {
"fields": ["*"]
},
"left2": {
"fields": ["*"]
},
"left3": {
"fields": ["*"]
},
"left4": {
"fields": ["*"]
},
"right1": {
"fields": ["*"]
},
"right2": {
"fields": ["*"]
},
"right3": {
"fields": ["*"]
},
"right4": {
"fields": ["*"]
}
}
}
}
}

View File

@@ -1,16 +1,22 @@
import {About_Plain} from "@/types/generated-strapi-interfaces/api/about";
import strapiClient from "@/app/api/strapi/strapi-client";
import {Payload} from "@/types/generated-strapi-interfaces/common/Payload";
import {StrapiQuery} from "@/app/api/strapi/strapi-query";
import qs from "qs";
import aboutQuery from "@/app/api/strapi/query/about.json";
class StrapiApi{
constructor( ) {
}
public getImageUrl(imagePath: string){
return strapiClient.getImageUrl(imagePath);
}
public async getAboutPage(): Promise<About_Plain>{
const query = qs.stringify(aboutQuery,{ arrayFormat: 'indices' , encode: false})
const payload = await strapiClient.httpGetJson<About_Plain>(
StrapiQuery.aboutUrl
"/api/about?"+ query
);
return payload?.data;

View File

@@ -7,6 +7,9 @@ class StrapiClient{
constructor(private strapiUrl: string = "http://localhost:1337") {
}
public getImageUrl(imagePath: string){
return this.strapiUrl + imagePath;
}
public async httpGet(path: string){
return await httpClient.httpGet(this.strapiUrl + path);
}