fix(guild): /guild/update response — flat detail under guild (matches GuildUpdateTask.Parse)
GuildUpdateTask.Parse() reads data[guild] as GuildDetailInfo directly; the previous GuildDetailSubTree wrapper (data[guild][detail]) caused json[guild_id].ToInt() to crash on the client. Split GuildUpdateResponse (flat) from GuildUpdateEmblemResponse (nested, correct for GuildEmblemUpdateTask.Parse). Also surfaces guild_name from the request through UpdateGuildRequest.Name -> service -> repo so the client rename is honoured. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,11 +5,22 @@ using SVSim.EmulatedEntrypoint.Models.Dtos.Common.Guild;
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
|
||||
|
||||
/// <summary>
|
||||
/// Response for POST /guild/update and POST /guild/update_emblem.
|
||||
/// Returns the full updated guild detail sub-tree; client merges without re-fetching members.
|
||||
/// Response for POST /guild/update.
|
||||
/// GuildUpdateTask.Parse() reads data["guild"] directly as GuildDetailInfo — flat, no "detail" wrapper.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class GuildUpdateResponse
|
||||
{
|
||||
[JsonPropertyName("guild"), Key("guild")]
|
||||
public GuildDetailDto Guild { get; set; } = new();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Response for POST /guild/update_emblem.
|
||||
/// GuildEmblemUpdateTask.Parse() reads data["guild"]["detail"] — requires the nested wrapper.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class GuildUpdateEmblemResponse
|
||||
{
|
||||
[JsonPropertyName("guild"), Key("guild")]
|
||||
public GuildDetailSubTree Guild { get; set; } = new();
|
||||
|
||||
Reference in New Issue
Block a user