Skip to content

Commit

Permalink
Don't serialize audit entry types into JSON body.
Browse files Browse the repository at this point in the history
Whoops.
  • Loading branch information
PJB3005 committed Jun 13, 2024
1 parent 66f5aa6 commit 4644340
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions SS14.Auth.Shared/Data/SpaceUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Text.Json;
using JetBrains.Annotations;
using Microsoft.AspNetCore.Identity;
using Newtonsoft.Json;
using SS14.WebEverythingShared;

namespace SS14.Auth.Shared.Data;
Expand Down Expand Up @@ -96,6 +97,7 @@ public abstract record AccountLogEntry
private static readonly Dictionary<Type, AccountLogType> TypeToEnum;
public static readonly Dictionary<AccountLogType, AccountLogRetainType> EnumToRetention;

[JsonIgnore]
public AccountLogType Type => TypeToEnum[GetType()];

static AccountLogEntry()
Expand Down
2 changes: 2 additions & 0 deletions SS14.ServerHub.Shared/Data/HubAudit.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;
using SS14.ServerHub.Shared.Helpers;
using SS14.WebEverythingShared;

Expand Down Expand Up @@ -178,6 +179,7 @@ public abstract record HubAuditEntry
private static readonly Dictionary<HubAuditType, Type> EnumToType;
private static readonly Dictionary<Type, HubAuditType> TypeToEnum;

[JsonIgnore]
public HubAuditType Type => TypeToEnum[GetType()];

static HubAuditEntry()
Expand Down

0 comments on commit 4644340

Please sign in to comment.