diff options
-rw-r--r-- | src/StardewModdingAPI.Web/Controllers/ModsController.cs | 15 | ||||
-rw-r--r-- | src/StardewModdingAPI.Web/Models/ModSearchModel.cs | 9 |
2 files changed, 2 insertions, 22 deletions
diff --git a/src/StardewModdingAPI.Web/Controllers/ModsController.cs b/src/StardewModdingAPI.Web/Controllers/ModsController.cs index 79c31c3f..06a80638 100644 --- a/src/StardewModdingAPI.Web/Controllers/ModsController.cs +++ b/src/StardewModdingAPI.Web/Controllers/ModsController.cs @@ -68,26 +68,15 @@ namespace StardewModdingAPI.Web.Controllers [HttpGet] public async Task<IDictionary<string, ModInfoModel>> GetAsync(string modKeys) { - return await this.PostAsync(new ModSearchModel - { - ModKeys = modKeys?.Split(',').Select(p => p.Trim()).ToArray() ?? new string[0] - }); - } - - /// <summary>Fetch version metadata for the given mods.</summary> - /// <param name="search">The search options.</param> - [HttpPost] - public async Task<IDictionary<string, ModInfoModel>> PostAsync([FromBody] ModSearchModel search) - { // sort & filter keys - string[] modKeys = (search.ModKeys ?? new string[0]) + string[] modKeysArray = (modKeys?.Split(',').Select(p => p.Trim()).ToArray() ?? new string[0]) .Distinct(StringComparer.CurrentCultureIgnoreCase) .OrderBy(p => p, StringComparer.CurrentCultureIgnoreCase) .ToArray(); // fetch mod info IDictionary<string, ModInfoModel> result = new Dictionary<string, ModInfoModel>(StringComparer.CurrentCultureIgnoreCase); - foreach (string modKey in modKeys) + foreach (string modKey in modKeysArray) { // parse mod key if (!this.TryParseModKey(modKey, out string vendorKey, out string modID)) diff --git a/src/StardewModdingAPI.Web/Models/ModSearchModel.cs b/src/StardewModdingAPI.Web/Models/ModSearchModel.cs deleted file mode 100644 index b9a73af6..00000000 --- a/src/StardewModdingAPI.Web/Models/ModSearchModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace StardewModdingAPI.Web.Models -{ - /// <summary>Metadata for mods to look up.</summary> - internal class ModSearchModel - { - /// <summary>The namespaced mod keys to search.</summary> - public string[] ModKeys { get; set; } - } -} |