Send yourReview with slot request (#189)

This commit is contained in:
Josh 2022-02-22 16:58:25 -06:00 committed by GitHub
commit 58617df273
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -7,6 +7,7 @@ using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Serialization;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Levels;
using LBPUnion.ProjectLighthouse.Types.Reviews;
using LBPUnion.ProjectLighthouse.Types.Settings;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
@ -99,7 +100,8 @@ public class SlotsController : ControllerBase
RatedLevel? ratedLevel = await this.database.RatedLevels.FirstOrDefaultAsync(r => r.SlotId == id && r.UserId == user.UserId);
VisitedLevel? visitedLevel = await this.database.VisitedLevels.FirstOrDefaultAsync(r => r.SlotId == id && r.UserId == user.UserId);
return this.Ok(slot.Serialize(gameVersion, ratedLevel, visitedLevel));
Review? review = await this.database.Reviews.FirstOrDefaultAsync(r => r.SlotId == id && r.ReviewerId == user.UserId);
return this.Ok(slot.Serialize(gameVersion, ratedLevel, visitedLevel, review));
}
[HttpGet("slots/cool")]

View file

@ -201,9 +201,9 @@ public class User
"planets",
gameVersion switch
{
GameVersion.LittleBigPlanet2 => PlanetHashLBP2,
GameVersion.LittleBigPlanet3 => PlanetHashLBP3,
GameVersion.LittleBigPlanetVita => PlanetHashLBPVita,
GameVersion.LittleBigPlanet2 => this.PlanetHashLBP2,
GameVersion.LittleBigPlanet3 => this.PlanetHashLBP3,
GameVersion.LittleBigPlanetVita => this.PlanetHashLBPVita,
_ => "", // other versions do not have custom planets
}
);