Skip to content

Commit

Permalink
hack a hack to allow /-1G as a url
Browse files Browse the repository at this point in the history
  • Loading branch information
adelikat committed Sep 18, 2024
1 parent ec7904d commit a0ca489
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions TASVideos/Pages/Games/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class IndexModel(ApplicationDbContext db) : BasePageModel
[FromRoute]
public string Id { get; set; } = "";

public int ParsedId => int.TryParse(Id, out var id) ? id : -1;
public int ParsedId => int.TryParse(Id, out var id) ? id : -2;

public GameDisplay Game { get; set; } = new();
public List<TabMiniMovieModel> Movies { get; set; } = [];
Expand Down Expand Up @@ -55,7 +55,7 @@ public async Task<IActionResult> OnGet()
.ToList(),
});

query = ParsedId > 0
query = ParsedId > -2
? query.Where(g => g.Id == ParsedId)
: query.Where(g => g.Abbreviation == Id);

Expand Down

0 comments on commit a0ca489

Please sign in to comment.