summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Web/Controllers
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-09-22 00:58:25 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-09-22 00:58:25 -0400
commit9c072333d161d2510ee884d71dc9a714bbf86033 (patch)
tree5c12a085b8d78ff4dcf27062658d2ea99ded9752 /src/StardewModdingAPI.Web/Controllers
parent2c02dfe45a6d1252bfef557db8f39f97e57d3d19 (diff)
downloadSMAPI-9c072333d161d2510ee884d71dc9a714bbf86033.tar.gz
SMAPI-9c072333d161d2510ee884d71dc9a714bbf86033.tar.bz2
SMAPI-9c072333d161d2510ee884d71dc9a714bbf86033.zip
rename mods endpoint & model (#336)
Diffstat (limited to 'src/StardewModdingAPI.Web/Controllers')
-rw-r--r--src/StardewModdingAPI.Web/Controllers/ModsController.cs (renamed from src/StardewModdingAPI.Web/Controllers/CheckController.cs)12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/StardewModdingAPI.Web/Controllers/CheckController.cs b/src/StardewModdingAPI.Web/Controllers/ModsController.cs
index 2a346cf3..bbf1744f 100644
--- a/src/StardewModdingAPI.Web/Controllers/CheckController.cs
+++ b/src/StardewModdingAPI.Web/Controllers/ModsController.cs
@@ -10,8 +10,7 @@ namespace StardewModdingAPI.Web.Controllers
{
/// <summary>Provides an API to perform mod update checks.</summary>
[Produces("application/json")]
- [Route("api/check")]
- public class CheckController : Controller
+ public class ModsController : Controller
{
/*********
** Properties
@@ -31,23 +30,24 @@ namespace StardewModdingAPI.Web.Controllers
/// <summary>Fetch version metadata for the given mods.</summary>
/// <param name="search">The mod update search criteria.</param>
[HttpPost]
- public async Task<ModGenericModel[]> Post([FromBody] ModSearchModel search)
+ [Route("mods")]
+ public async Task<ModInfoModel[]> Post([FromBody] ModSearchModel search)
{
- IList<ModGenericModel> result = new List<ModGenericModel>();
+ IList<ModInfoModel> result = new List<ModInfoModel>();
foreach (string modKey in search.ModKeys)
{
// parse mod key
if (!this.TryParseModKey(modKey, out string vendorKey, out string modID))
{
- result.Add(new ModGenericModel(modKey, "The mod key isn't in a valid format. It should contain the mod repository key and mod ID like 'Nexus:541'."));
+ result.Add(new ModInfoModel(modKey, "The mod key isn't in a valid format. It should contain the mod repository key and mod ID like 'Nexus:541'."));
continue;
}
// get matching repository
if (!this.Repositories.TryGetValue(vendorKey, out IModRepository repository))
{
- result.Add(new ModGenericModel(modKey, "There's no mod repository matching this namespaced mod ID."));
+ result.Add(new ModInfoModel(modKey, "There's no mod repository matching this namespaced mod ID."));
continue;
}