Skip to content

Commit

Permalink
Allow saving post without category #733
Browse files Browse the repository at this point in the history
  • Loading branch information
EdiWang committed Jul 26, 2023
1 parent ce73107 commit 078c2df
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/Moonglade.Core/PostFeature/PostEditModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public class PostEditModel
[MaxLength(64)]
public string Author { get; set; }

[Required]
[MinLength(1)]
public Guid[] SelectedCatIds { get; set; }

[Required]
Expand Down
4 changes: 0 additions & 4 deletions src/Moonglade.Web/Pages/Admin/EditPost.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@
}
var selectedCatIds = data.getAll('SelectedCatIds');
if (selectedCatIds.length == 0) {
blogToast.error('Please select at least 1 category.');
return;
}
value["SelectedCatIds"] = selectedCatIds;
const newValue = utils.toMagicJson(value);
Expand Down

0 comments on commit 078c2df

Please sign in to comment.