Skip to content

Commit

Permalink
feat: Also added endpoint for projectid-json, to enable fetching data…
Browse files Browse the repository at this point in the history
… for deleted projects
  • Loading branch information
itssimple committed Jun 25, 2024
1 parent cf8fa11 commit fabc81b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions CFLookup/ApiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,25 @@ public async Task<IActionResult> GetSlugProject(string game, string category, st
return NotFound();
}
}

[HttpGet("/{projectId}.json")]
public async Task<IActionResult> GetProject(int projectId)
{
try
{
var project = await SharedMethods.SearchModAsync(_redis, _cfApiClient, projectId);

if (project == null)
{
return NotFound();
}

return new JsonResult(project);
}
catch
{
return NotFound();
}
}
}
}

0 comments on commit fabc81b

Please sign in to comment.