Skip to content

Commit

Permalink
optimize minor
Browse files Browse the repository at this point in the history
  • Loading branch information
boscohyun committed May 13, 2024
1 parent e326212 commit d9cf287
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions Mimir/Controllers/AvatarController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using Mimir.Repositories;
using Mimir.Services;
using Mimir.Util;
using MongoDB.Bson;
using Nekoyume.Model.State;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
Expand Down Expand Up @@ -119,18 +118,6 @@ public override void WriteJson(JsonWriter writer, object? value, JsonSerializer
return null;
}

try
{
var jsonString = JsonConvert.SerializeObject(inventoryState, JsonSerializerSettings);
var bsonDocument = BsonDocument.Parse(jsonString);
inventory = new Inventory(bsonDocument);
}
catch
{
Response.StatusCode = StatusCodes.Status500InternalServerError;
return null;
}

return inventory;
return new Inventory(inventoryState);
}
}

0 comments on commit d9cf287

Please sign in to comment.