Skip to content

Commit fabc81b

Browse files
committed
feat: Also added endpoint for projectid-json, to enable fetching data for deleted projects
1 parent cf8fa11 commit fabc81b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

CFLookup/ApiController.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,25 @@ public async Task<IActionResult> GetSlugProject(string game, string category, st
4141
return NotFound();
4242
}
4343
}
44+
45+
[HttpGet("/{projectId}.json")]
46+
public async Task<IActionResult> GetProject(int projectId)
47+
{
48+
try
49+
{
50+
var project = await SharedMethods.SearchModAsync(_redis, _cfApiClient, projectId);
51+
52+
if (project == null)
53+
{
54+
return NotFound();
55+
}
56+
57+
return new JsonResult(project);
58+
}
59+
catch
60+
{
61+
return NotFound();
62+
}
63+
}
4464
}
4565
}

0 commit comments

Comments
 (0)