From 3bbd9dcbf69da867aa59d7e20e0e8407de338621 Mon Sep 17 00:00:00 2001 From: Roland Schneider Date: Sun, 8 Jun 2025 21:12:59 +0200 Subject: [PATCH] [yoga-11] add common type and add logo --- yoga-app/src/app/services/[slug]/page.tsx | 2 +- .../generated-strapi-interfaces/api/yoga-common.ts | 4 ++++ .../content-types/yoga-common/schema.json | 14 ++++++++++---- yoga-cms/types/generated/contentTypes.d.ts | 2 ++ 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/yoga-app/src/app/services/[slug]/page.tsx b/yoga-app/src/app/services/[slug]/page.tsx index 04b4c6c..a972c19 100644 --- a/yoga-app/src/app/services/[slug]/page.tsx +++ b/yoga-app/src/app/services/[slug]/page.tsx @@ -31,7 +31,7 @@ export default async function ServiceArticlePage({params}: { if (!servicePage) { return notFound() } - const {subscribeNow, footer} = servicePage; + const {subscribeNow, footer, common} = servicePage; const servicesByName = await strapiApi.getService(slug); if (!servicesByName || servicesByName.length === 0) { return notFound(); diff --git a/yoga-cms/generated-strapi-interfaces/api/yoga-common.ts b/yoga-cms/generated-strapi-interfaces/api/yoga-common.ts index 38e4113..71bf8a5 100644 --- a/yoga-cms/generated-strapi-interfaces/api/yoga-common.ts +++ b/yoga-cms/generated-strapi-interfaces/api/yoga-common.ts @@ -8,19 +8,23 @@ export interface YogaCommon { id: number; attributes: { createdAt: Date; updatedAt: Date; publishedAt?: Date; logoImage?: { data: Media }; + name: string; }; } export interface YogaCommon_Plain { id: number; createdAt: Date; updatedAt: Date; publishedAt?: Date; logoImage?: Media_Plain; + name: string; } export interface YogaCommon_NoRelations { id: number; createdAt: Date; updatedAt: Date; publishedAt?: Date; logoImage?: number; + name: string; } export interface YogaCommon_AdminPanelLifeCycle { id: number; createdAt: Date; updatedAt: Date; publishedAt?: Date; logoImage?: AdminPanelRelationPropertyModification; + name: string; } diff --git a/yoga-cms/src/api/yoga-common/content-types/yoga-common/schema.json b/yoga-cms/src/api/yoga-common/content-types/yoga-common/schema.json index c422d5d..eeaa7ec 100644 --- a/yoga-cms/src/api/yoga-common/content-types/yoga-common/schema.json +++ b/yoga-cms/src/api/yoga-common/content-types/yoga-common/schema.json @@ -4,21 +4,27 @@ "info": { "singularName": "yoga-common", "pluralName": "yoga-commons", - "displayName": "YogaCommon" + "displayName": "YogaCommon", + "description": "" }, "options": { "draftAndPublish": true }, "attributes": { "logoImage": { + "type": "media", + "multiple": false, + "required": false, "allowedTypes": [ "images", "files", "videos", "audios" - ], - "type": "media", - "multiple": false + ] + }, + "name": { + "type": "string", + "required": true } } } diff --git a/yoga-cms/types/generated/contentTypes.d.ts b/yoga-cms/types/generated/contentTypes.d.ts index 58c53ea..e7a66f1 100644 --- a/yoga-cms/types/generated/contentTypes.d.ts +++ b/yoga-cms/types/generated/contentTypes.d.ts @@ -1237,6 +1237,7 @@ export interface ApiYogaBlogPostsComponentYogaBlogPostsComponent export interface ApiYogaCommonYogaCommon extends Struct.CollectionTypeSchema { collectionName: 'yoga_commons'; info: { + description: ''; displayName: 'YogaCommon'; pluralName: 'yoga-commons'; singularName: 'yoga-common'; @@ -1255,6 +1256,7 @@ export interface ApiYogaCommonYogaCommon extends Struct.CollectionTypeSchema { > & Schema.Attribute.Private; logoImage: Schema.Attribute.Media<'images' | 'files' | 'videos' | 'audios'>; + name: Schema.Attribute.String & Schema.Attribute.Required; publishedAt: Schema.Attribute.DateTime; updatedAt: Schema.Attribute.DateTime; updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &