mirror of
https://github.com/CyberL1/Minecraft-Realms-Emulator.git
synced 2024-11-21 21:58:21 -05:00
fix: show include in world settings
This commit is contained in:
parent
0a9cb2d41c
commit
2b1c55d030
@ -99,7 +99,7 @@ namespace Minecraft_Realms_Emulator.Controllers
|
||||
|
||||
if (body.Name == playerName) return Forbid("You cannot invite yourself");
|
||||
|
||||
var world = await _context.Worlds.FirstOrDefaultAsync(w => w.Id == wId);
|
||||
var world = await _context.Worlds.Include(w => w.Players).FirstOrDefaultAsync(w => w.Id == wId);
|
||||
|
||||
if (world == null) return NotFound("World not found");
|
||||
|
||||
@ -118,7 +118,6 @@ namespace Minecraft_Realms_Emulator.Controllers
|
||||
};
|
||||
|
||||
_context.Players.Add(player);
|
||||
// world.Players.Add(player);
|
||||
|
||||
Invite invite = new()
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ namespace Minecraft_Realms_Emulator.Controllers
|
||||
[HttpGet("{id}")]
|
||||
public async Task<ActionResult<World>> GetWorldById(int id)
|
||||
{
|
||||
var world = await _context.Worlds.FindAsync(id);
|
||||
var world = await _context.Worlds.Include(w => w.Players).FirstOrDefaultAsync(w => w.Id == id);
|
||||
|
||||
if (world == null) return NotFound("World not found");
|
||||
|
||||
|
@ -5,7 +5,7 @@ var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
|
||||
builder.Services.AddControllers();
|
||||
builder.Services.AddControllers().AddJsonOptions(x => x.JsonSerializerOptions.ReferenceHandler = System.Text.Json.Serialization.ReferenceHandler.IgnoreCycles);
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
Loading…
Reference in New Issue
Block a user