0.11.16 : change public to isPublic (strict keyword)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "harmony-back",
|
"name": "harmony-back",
|
||||||
"version": "0.11.15",
|
"version": "0.11.16",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "A Strapi application",
|
"description": "A Strapi application",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
"target": "api::post.post",
|
"target": "api::post.post",
|
||||||
"inversedBy": "post_ownerships"
|
"inversedBy": "post_ownerships"
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false
|
"default": false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export default factories.createCoreController(
|
|||||||
({ strapi }) => ({
|
({ strapi }) => ({
|
||||||
async create(ctx) {
|
async create(ctx) {
|
||||||
const data = JSON.parse(ctx.request.body.data);
|
const data = JSON.parse(ctx.request.body.data);
|
||||||
|
const isPublic = data.isPublic ?? false;
|
||||||
if (ctx.request.files.media) {
|
if (ctx.request.files.media) {
|
||||||
const files = Array.isArray(ctx.request.files.media)
|
const files = Array.isArray(ctx.request.files.media)
|
||||||
? ctx.request.files.media[0]
|
? ctx.request.files.media[0]
|
||||||
@@ -35,6 +35,7 @@ export default factories.createCoreController(
|
|||||||
}
|
}
|
||||||
|
|
||||||
delete data.author;
|
delete data.author;
|
||||||
|
delete data.isPublic;
|
||||||
ctx.request.body = { data };
|
ctx.request.body = { data };
|
||||||
const result = await super.create(ctx);
|
const result = await super.create(ctx);
|
||||||
|
|
||||||
@@ -48,6 +49,7 @@ export default factories.createCoreController(
|
|||||||
contextType: "user",
|
contextType: "user",
|
||||||
contextId: userId,
|
contextId: userId,
|
||||||
relation: "owner",
|
relation: "owner",
|
||||||
|
isPublic: isPublic,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
"name": "Apache 2.0",
|
"name": "Apache 2.0",
|
||||||
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
|
"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": {
|
"x-strapi-config": {
|
||||||
"plugins": [
|
"plugins": [
|
||||||
@@ -17502,7 +17502,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -20956,7 +20956,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -24895,7 +24895,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -28393,7 +28393,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -32339,7 +32339,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -36536,7 +36536,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -41182,7 +41182,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -45118,7 +45118,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -48956,7 +48956,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -52781,7 +52781,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -56642,7 +56642,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -60503,7 +60503,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -64325,7 +64325,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -68328,7 +68328,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -71820,7 +71820,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -76241,7 +76241,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -80062,7 +80062,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -84200,7 +84200,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -88041,7 +88041,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -91988,7 +91988,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -95836,7 +95836,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -99189,7 +99189,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -103751,7 +103751,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -104358,7 +104358,7 @@
|
|||||||
],
|
],
|
||||||
"example": "string or id"
|
"example": "string or id"
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"locale": {
|
"locale": {
|
||||||
@@ -107642,7 +107642,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -108099,7 +108099,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
@@ -111493,7 +111493,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"public": {
|
"isPublic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"createdAt": {
|
"createdAt": {
|
||||||
|
|||||||
2
types/generated/contentTypes.d.ts
vendored
2
types/generated/contentTypes.d.ts
vendored
@@ -1271,6 +1271,7 @@ export interface ApiPostOwnershipPostOwnership
|
|||||||
createdAt: Schema.Attribute.DateTime;
|
createdAt: Schema.Attribute.DateTime;
|
||||||
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||||
Schema.Attribute.Private;
|
Schema.Attribute.Private;
|
||||||
|
isPublic: Schema.Attribute.Boolean & Schema.Attribute.DefaultTo<false>;
|
||||||
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||||
localizations: Schema.Attribute.Relation<
|
localizations: Schema.Attribute.Relation<
|
||||||
'oneToMany',
|
'oneToMany',
|
||||||
@@ -1279,7 +1280,6 @@ export interface ApiPostOwnershipPostOwnership
|
|||||||
Schema.Attribute.Private;
|
Schema.Attribute.Private;
|
||||||
metas: Schema.Attribute.JSON;
|
metas: Schema.Attribute.JSON;
|
||||||
post: Schema.Attribute.Relation<'manyToOne', 'api::post.post'>;
|
post: Schema.Attribute.Relation<'manyToOne', 'api::post.post'>;
|
||||||
public: Schema.Attribute.Boolean & Schema.Attribute.DefaultTo<false>;
|
|
||||||
publishedAt: Schema.Attribute.DateTime;
|
publishedAt: Schema.Attribute.DateTime;
|
||||||
relation: Schema.Attribute.Enumeration<
|
relation: Schema.Attribute.Enumeration<
|
||||||
['owner', 'saved', 'hidden', 'link']
|
['owner', 'saved', 'hidden', 'link']
|
||||||
|
|||||||
Reference in New Issue
Block a user