restore test value
All checks were successful
Game Ideas build for PR / build_blazor_app (pull_request) Successful in 46s
All checks were successful
Game Ideas build for PR / build_blazor_app (pull_request) Successful in 46s
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using GameIdeas.Shared.Dto;
|
using GameIdeas.Shared.Dto;
|
||||||
|
using GameIdeas.Shared.Enum;
|
||||||
using GameIdeas.Shared.Exceptions;
|
using GameIdeas.Shared.Exceptions;
|
||||||
using GameIdeas.Shared.Model;
|
using GameIdeas.Shared.Model;
|
||||||
using GameIdeas.WebAPI.Context;
|
using GameIdeas.WebAPI.Context;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System.Data.SqlTypes;
|
||||||
|
|
||||||
namespace GameIdeas.WebAPI.Services;
|
namespace GameIdeas.WebAPI.Services;
|
||||||
|
|
||||||
@@ -27,7 +29,26 @@ public class GameService(GameIdeasContext context, IMapper mapper)
|
|||||||
.Take(pagging.NumberPerPage)
|
.Take(pagging.NumberPerPage)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
return mapper.Map<IEnumerable<GameDto>>(games);
|
List<Game> gameTest = [ new() { Id = 1,
|
||||||
|
Title = "Test",
|
||||||
|
CreationDate = DateTime.Today - TimeSpan.FromHours(-12),
|
||||||
|
CreationUser = new User() { Id = 1, Username = "Test", Role = (int)Role.Administrator },
|
||||||
|
CreationUserId = 1,
|
||||||
|
Description = "Test",
|
||||||
|
GameDevelopers = [new() { Developer = new Developer() { Id = 1, Name = "THQNordic" } }],
|
||||||
|
GamePlatforms = [new() { Platform = new Platform() { Id = 1, Label = "Steam" }, Url = "steam.com?app=55554131" }],
|
||||||
|
GameProperties = [new() { Property = new Property() { Id = 1, Label = "Coop" } }],
|
||||||
|
GamePublishers = [new() { Publisher = new Publisher() { Id = 1, Name = "Take-Two" } }],
|
||||||
|
GameTags = [new() { Tag = new Tag() { Id = 1, Label = "RPG" } }],
|
||||||
|
Interest = 5,
|
||||||
|
ModificationDate = DateTime.Today ,
|
||||||
|
ModificationUser = new User() { Id = 2, Username = "Test 2", Role = (int)Role.Member },
|
||||||
|
ModificationUserId = 2,
|
||||||
|
ReleaseDate = new DateTime(2025, 2, 1),
|
||||||
|
StorageSpace = 40
|
||||||
|
} ];
|
||||||
|
|
||||||
|
return mapper.Map<IEnumerable<GameDto>>(gameTest);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GameDto> GetGameById(int gameId)
|
public async Task<GameDto> GetGameById(int gameId)
|
||||||
|
|||||||
Reference in New Issue
Block a user