feat(postit): show a live published badge beside blog post titles

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Paul Schneider 2026-10-09 17:46:32 +01:00
commit e7721bc3ab
Signed by: notazof
GPG key ID: AD4B9B545FBD7D12
3 changed files with 40 additions and 3 deletions

View file

@ -1,12 +1,16 @@
#nullable enable annotations
using Yavsc.Abstract.Identity.Security;
using System.ComponentModel;
using System.Text.Json.Serialization;
namespace Yavsc.Blogspot;
public class BlogPostDto : IBlogPost
public class BlogPostDto : IBlogPost, INotifyPropertyChanged
{
public event PropertyChangedEventHandler? PropertyChanged;
private bool _isPublished;
public string AuthorId { get; set; }
public BlogPostAuthorDto? Author { get; set; }
@ -30,7 +34,18 @@ public class BlogPostDto : IBlogPost
/// follow-up request. Toggled via
/// <c>PUT /api/BlogApi/{id}/publish</c>.
/// </summary>
public bool IsPublished { get; set; }
public bool IsPublished
{
get => _isPublished;
set
{
if (_isPublished == value)
return;
_isPublished = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsPublished)));
}
}
public virtual bool AuthorizeCircle(long circleId)
{