0.11.16 : change public to isPublic (strict keyword)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "harmony-back",
|
||||
"version": "0.11.15",
|
||||
"version": "0.11.16",
|
||||
"private": true,
|
||||
"description": "A Strapi application",
|
||||
"scripts": {
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
"target": "api::post.post",
|
||||
"inversedBy": "post_ownerships"
|
||||
},
|
||||
"public": {
|
||||
"isPublic": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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": {
|
||||
|
||||
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;
|
||||
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
isPublic: Schema.Attribute.Boolean & Schema.Attribute.DefaultTo<false>;
|
||||
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<false>;
|
||||
publishedAt: Schema.Attribute.DateTime;
|
||||
relation: Schema.Attribute.Enumeration<
|
||||
['owner', 'saved', 'hidden', 'link']
|
||||
|
||||
Reference in New Issue
Block a user