Add game website URL to suggestions and results

This commit is contained in:
2026-01-28 20:25:02 +01:00
parent e15dd02228
commit 1b96d2af46
8 changed files with 228 additions and 4 deletions

View File

@@ -27,13 +27,14 @@ public static class SuggestEndpoints
s.Description,
s.ScreenshotUrl,
s.YoutubeUrl,
s.GameUrl,
s.CreatedAt
})
.ToListAsync();
var ordered = mine
.OrderBy(s => s.CreatedAt)
.Select(s => new SuggestionDto(s.Id, s.Name, s.Genre, s.Description, s.ScreenshotUrl, s.YoutubeUrl));
.Select(s => new SuggestionDto(s.Id, s.Name, s.Genre, s.Description, s.ScreenshotUrl, s.YoutubeUrl, s.GameUrl));
return Results.Ok(ordered);
});
@@ -69,7 +70,8 @@ public static class SuggestEndpoints
Genre = EndpointHelpers.TrimTo(request.Genre, 50),
Description = EndpointHelpers.TrimTo(request.Description, 500),
ScreenshotUrl = EndpointHelpers.TrimTo(request.ScreenshotUrl, 2048),
YoutubeUrl = EndpointHelpers.TrimTo(request.YoutubeUrl, 2048)
YoutubeUrl = EndpointHelpers.TrimTo(request.YoutubeUrl, 2048),
GameUrl = EndpointHelpers.TrimTo(request.GameUrl, 2048)
};
db.Suggestions.Add(suggestion);
@@ -110,6 +112,7 @@ public static class SuggestEndpoints
s.Description,
s.ScreenshotUrl,
s.YoutubeUrl,
s.GameUrl,
Author = s.Player!.DisplayName,
s.CreatedAt
})
@@ -125,6 +128,7 @@ public static class SuggestEndpoints
s.Description,
s.ScreenshotUrl,
s.YoutubeUrl,
s.GameUrl,
s.Author
});