✨ Include account info for personal publishers
This commit is contained in:
parent
fcaeb9afbe
commit
acece9cbce
3402
DysonNetwork.Sphere/Migrations/20250527144902_LimitedSizeForPictureIdOnPub.Designer.cs
generated
Normal file
3402
DysonNetwork.Sphere/Migrations/20250527144902_LimitedSizeForPictureIdOnPub.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,22 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DysonNetwork.Sphere.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class LimitedSizeForPictureIdOnPub : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -1775,6 +1775,7 @@ namespace DysonNetwork.Sphere.Migrations
|
||||
.HasColumnName("account_id");
|
||||
|
||||
b.Property<string>("BackgroundId")
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("character varying(32)")
|
||||
.HasColumnName("background_id");
|
||||
|
||||
@ -1804,6 +1805,7 @@ namespace DysonNetwork.Sphere.Migrations
|
||||
.HasColumnName("nick");
|
||||
|
||||
b.Property<string>("PictureId")
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("character varying(32)")
|
||||
.HasColumnName("picture_id");
|
||||
|
||||
|
@ -22,9 +22,9 @@ public class Publisher : ModelBase
|
||||
[MaxLength(256)] public string Nick { get; set; } = string.Empty;
|
||||
[MaxLength(4096)] public string? Bio { get; set; }
|
||||
|
||||
public string? PictureId { get; set; }
|
||||
[MaxLength(32)] public string? PictureId { get; set; }
|
||||
public CloudFile? Picture { get; set; }
|
||||
public string? BackgroundId { get; set; }
|
||||
[MaxLength(32)] public string? BackgroundId { get; set; }
|
||||
public CloudFile? Background { get; set; }
|
||||
|
||||
[JsonIgnore] public ICollection<Post.Post> Posts { get; set; } = new List<Post.Post>();
|
||||
@ -35,7 +35,7 @@ public class Publisher : ModelBase
|
||||
public ICollection<PublisherSubscription> Subscriptions { get; set; } = new List<PublisherSubscription>();
|
||||
|
||||
public Guid? AccountId { get; set; }
|
||||
[JsonIgnore] public Account.Account? Account { get; set; }
|
||||
public Account.Account? Account { get; set; }
|
||||
public Guid? RealmId { get; set; }
|
||||
[JsonIgnore] public Realm.Realm? Realm { get; set; }
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ public class PublisherController(AppDatabase db, PublisherService ps, FileServic
|
||||
public async Task<ActionResult<Publisher>> GetPublisher(string name)
|
||||
{
|
||||
var publisher = await db.Publishers
|
||||
.Include(e => e.Account)
|
||||
.Where(e => e.Name == name)
|
||||
.FirstOrDefaultAsync();
|
||||
if (publisher is null) return NotFound();
|
||||
|
Loading…
x
Reference in New Issue
Block a user