0.11.16 : change public to isPublic (strict keyword)

This commit is contained in:
2025-11-07 15:31:23 +01:00
parent 4071000895
commit 90e43e0644
5 changed files with 34 additions and 32 deletions

View File

@@ -48,7 +48,7 @@
"target": "api::post.post",
"inversedBy": "post_ownerships"
},
"public": {
"isPublic": {
"type": "boolean",
"default": false
}

View File

@@ -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,
},
});
}

View File

@@ -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": {