🐛 Bug fixes

This commit is contained in:
2025-07-19 02:49:39 +08:00
parent 57f85ec341
commit e0e1eb76cd
12 changed files with 37 additions and 16 deletions

View File

@@ -2,11 +2,11 @@ using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
using DysonNetwork.Shared.Data;
using DysonNetwork.Shared.Proto;
using DysonNetwork.Sphere.Post;
using Microsoft.EntityFrameworkCore;
using NodaTime;
using VerificationMark = DysonNetwork.Shared.Data.VerificationMark;
using Account = DysonNetwork.Pass.Account.Account;
namespace DysonNetwork.Sphere.Publisher;

View File

@@ -34,7 +34,7 @@ public class PublisherController(
var account = await accounts.GetAccountAsync(
new GetAccountRequest { Id = publisher.AccountId.Value.ToString() }
);
publisher.Account = account;
publisher.Account = Pass.Account.Account.FromProtoValue(account);
return Ok(publisher);
}

View File

@@ -163,8 +163,12 @@ public class PublisherService(
Name = name ?? account.Name,
Nick = nick ?? account.Nick,
Bio = bio ?? account.Profile.Bio,
Picture = picture ?? CloudFileReferenceObject.FromProtoValue(account.Profile.Picture),
Background = background ?? CloudFileReferenceObject.FromProtoValue(account.Profile.Background),
Picture = picture ?? (account.Profile.Picture is null
? null
: CloudFileReferenceObject.FromProtoValue(account.Profile.Picture)),
Background = background ?? (account.Profile.Background is null
? null
: CloudFileReferenceObject.FromProtoValue(account.Profile.Background)),
AccountId = Guid.Parse(account.Id),
Members = new List<PublisherMember>
{
@@ -191,6 +195,7 @@ public class PublisherService(
}
);
}
if (publisher.Background is not null)
{
await fileRefs.CreateReferenceAsync(
@@ -250,6 +255,7 @@ public class PublisherService(
}
);
}
if (publisher.Background is not null)
{
await fileRefs.CreateReferenceAsync(