Skip to content

Commit 374f822

Browse files
committed
Fix publish unpublish
1 parent 326345d commit 374f822

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.github/workflows/admin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy Admin-panel
33
on:
44
push:
55
branches:
6-
- main
6+
- fix-update-form-author-issue
77

88
jobs:
99
deploy-admin-panel:

admin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
"strapi": {
4040
"uuid": "b6b5fb58-ed76-44ab-8910-3857abbf3b9f"
4141
}
42-
}
42+
}

admin/src/api/post/content-types/post/lifecycles.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ function generateRandomNumber() {
147147
}
148148

149149
function validateFields(result) {
150+
// no need to validate if it's only going to publish or unpublish
151+
if (Object.keys(result).length <= 3) {
152+
return;
153+
}
154+
150155
// set required message for summary,tags and meta_description
151156
if (!result.title) {
152157
const error = new YupValidationError({
@@ -197,7 +202,7 @@ function validateFields(result) {
197202
});
198203
throw error;
199204
}
200-
if (result.blog_content == '') {
205+
if (result.blog_content == "") {
201206
const error = new YupValidationError({
202207
path: "blog_content",
203208
message: "This value is required.",

0 commit comments

Comments
 (0)