🐛 Fix missing pagination query in discovery controller
This commit is contained in:
parent
0bdd429d87
commit
9f8eec792b
@ -1,6 +1,3 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using DysonNetwork.Sphere.Realm;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace DysonNetwork.Sphere.Discovery;
|
namespace DysonNetwork.Sphere.Discovery;
|
||||||
@ -10,8 +7,13 @@ namespace DysonNetwork.Sphere.Discovery;
|
|||||||
public class DiscoveryController(DiscoveryService discoveryService) : ControllerBase
|
public class DiscoveryController(DiscoveryService discoveryService) : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet("realms")]
|
[HttpGet("realms")]
|
||||||
public Task<List<Realm.Realm>> GetPublicRealms([FromQuery] string? query, [FromQuery] List<string>? tags)
|
public Task<List<Realm.Realm>> GetPublicRealms(
|
||||||
|
[FromQuery] string? query,
|
||||||
|
[FromQuery] List<string>? tags,
|
||||||
|
[FromQuery] int take = 10,
|
||||||
|
[FromQuery] int offset = 0
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return discoveryService.GetPublicRealmsAsync(query, tags);
|
return discoveryService.GetPublicRealmsAsync(query, tags, take, offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,10 +1,4 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using DysonNetwork.Sphere;
|
|
||||||
using DysonNetwork.Sphere.Realm;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace DysonNetwork.Sphere.Discovery;
|
namespace DysonNetwork.Sphere.Discovery;
|
||||||
|
|
||||||
public class DiscoveryService(AppDatabase appDatabase)
|
public class DiscoveryService(AppDatabase appDatabase)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user