From 90e43e0644461b6e37ffd943c8397e3259127f9f Mon Sep 17 00:00:00 2001 From: julien vdb Date: Fri, 7 Nov 2025 15:31:23 +0100 Subject: [PATCH] 0.11.16 : change public to isPublic (strict keyword) --- package.json | 2 +- .../content-types/post-ownership/schema.json | 2 +- src/api/post/controllers/post.ts | 4 +- .../1.0.0/full_documentation.json | 56 +++++++++---------- types/generated/contentTypes.d.ts | 2 +- 5 files changed, 34 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index 581b31e..b587606 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "harmony-back", - "version": "0.11.15", + "version": "0.11.16", "private": true, "description": "A Strapi application", "scripts": { diff --git a/src/api/post-ownership/content-types/post-ownership/schema.json b/src/api/post-ownership/content-types/post-ownership/schema.json index f0657e7..89dbf3e 100644 --- a/src/api/post-ownership/content-types/post-ownership/schema.json +++ b/src/api/post-ownership/content-types/post-ownership/schema.json @@ -48,7 +48,7 @@ "target": "api::post.post", "inversedBy": "post_ownerships" }, - "public": { + "isPublic": { "type": "boolean", "default": false } diff --git a/src/api/post/controllers/post.ts b/src/api/post/controllers/post.ts index 8a932be..62c9b31 100644 --- a/src/api/post/controllers/post.ts +++ b/src/api/post/controllers/post.ts @@ -9,7 +9,7 @@ export default factories.createCoreController( ({ strapi }) => ({ async create(ctx) { const data = JSON.parse(ctx.request.body.data); - + const isPublic = data.isPublic ?? false; if (ctx.request.files.media) { const files = Array.isArray(ctx.request.files.media) ? ctx.request.files.media[0] @@ -35,6 +35,7 @@ export default factories.createCoreController( } delete data.author; + delete data.isPublic; ctx.request.body = { data }; const result = await super.create(ctx); @@ -48,6 +49,7 @@ export default factories.createCoreController( contextType: "user", contextId: userId, relation: "owner", + isPublic: isPublic, }, }); } diff --git a/src/extensions/documentation/documentation/1.0.0/full_documentation.json b/src/extensions/documentation/documentation/1.0.0/full_documentation.json index 0500600..f2762f7 100644 --- a/src/extensions/documentation/documentation/1.0.0/full_documentation.json +++ b/src/extensions/documentation/documentation/1.0.0/full_documentation.json @@ -14,7 +14,7 @@ "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html" }, - "x-generation-date": "2025-11-07T13:39:27.019Z" + "x-generation-date": "2025-11-07T14:28:24.261Z" }, "x-strapi-config": { "plugins": [ @@ -17502,7 +17502,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -20956,7 +20956,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -24895,7 +24895,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -28393,7 +28393,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -32339,7 +32339,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -36536,7 +36536,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -41182,7 +41182,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -45118,7 +45118,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -48956,7 +48956,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -52781,7 +52781,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -56642,7 +56642,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -60503,7 +60503,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -64325,7 +64325,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -68328,7 +68328,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -71820,7 +71820,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -76241,7 +76241,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -80062,7 +80062,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -84200,7 +84200,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -88041,7 +88041,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -91988,7 +91988,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -95836,7 +95836,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -99189,7 +99189,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -103751,7 +103751,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -104358,7 +104358,7 @@ ], "example": "string or id" }, - "public": { + "isPublic": { "type": "boolean" }, "locale": { @@ -107642,7 +107642,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -108099,7 +108099,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { @@ -111493,7 +111493,7 @@ } } }, - "public": { + "isPublic": { "type": "boolean" }, "createdAt": { diff --git a/types/generated/contentTypes.d.ts b/types/generated/contentTypes.d.ts index 30f80da..e6e8129 100644 --- a/types/generated/contentTypes.d.ts +++ b/types/generated/contentTypes.d.ts @@ -1271,6 +1271,7 @@ export interface ApiPostOwnershipPostOwnership createdAt: Schema.Attribute.DateTime; createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & Schema.Attribute.Private; + isPublic: Schema.Attribute.Boolean & Schema.Attribute.DefaultTo; locale: Schema.Attribute.String & Schema.Attribute.Private; localizations: Schema.Attribute.Relation< 'oneToMany', @@ -1279,7 +1280,6 @@ export interface ApiPostOwnershipPostOwnership Schema.Attribute.Private; metas: Schema.Attribute.JSON; post: Schema.Attribute.Relation<'manyToOne', 'api::post.post'>; - public: Schema.Attribute.Boolean & Schema.Attribute.DefaultTo; publishedAt: Schema.Attribute.DateTime; relation: Schema.Attribute.Enumeration< ['owner', 'saved', 'hidden', 'link']