Skip to content

Commit

Permalink
Fix publish unpublish
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-dharti-r committed Jun 27, 2024
1 parent 326345d commit 374f822
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy Admin-panel
on:
push:
branches:
- main
- fix-update-form-author-issue

jobs:
deploy-admin-panel:
Expand Down
2 changes: 1 addition & 1 deletion admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@
"strapi": {
"uuid": "b6b5fb58-ed76-44ab-8910-3857abbf3b9f"
}
}
}
7 changes: 6 additions & 1 deletion admin/src/api/post/content-types/post/lifecycles.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ function generateRandomNumber() {
}

function validateFields(result) {
// no need to validate if it's only going to publish or unpublish
if (Object.keys(result).length <= 3) {
return;
}

// set required message for summary,tags and meta_description
if (!result.title) {
const error = new YupValidationError({
Expand Down Expand Up @@ -197,7 +202,7 @@ function validateFields(result) {
});
throw error;
}
if (result.blog_content == '') {
if (result.blog_content == "") {
const error = new YupValidationError({
path: "blog_content",
message: "This value is required.",
Expand Down

0 comments on commit 374f822

Please sign in to comment.