feat(dashboard): add tos/privacy/about pages, add delete all data page + endpoint
This commit is contained in:
parent
ac54b78a13
commit
31b6ac2cac
21 changed files with 527 additions and 28 deletions
|
|
@ -20,13 +20,25 @@ using Microsoft.AspNetCore.Mvc;
|
|||
namespace Catalogger.Backend.Api;
|
||||
|
||||
[Route("/api")]
|
||||
public class MetaController(GuildCache guildCache, DiscordRequestService discordRequestService)
|
||||
: ApiControllerBase
|
||||
public class MetaController(
|
||||
Config config,
|
||||
GuildCache guildCache,
|
||||
DiscordRequestService discordRequestService
|
||||
) : ApiControllerBase
|
||||
{
|
||||
[HttpGet("meta")]
|
||||
public IActionResult GetMeta()
|
||||
{
|
||||
return Ok(new MetaResponse(Guilds: (int)CataloggerMetrics.GuildsCached.Value));
|
||||
var inviteUrl =
|
||||
$"https://discord.com/oauth2/authorize?client_id={config.Discord.ApplicationId}"
|
||||
+ "&permissions=537250993&scope=bot+applications.commands";
|
||||
|
||||
return Ok(
|
||||
new MetaResponse(
|
||||
Guilds: (int)CataloggerMetrics.GuildsCached.Value,
|
||||
InviteUrl: inviteUrl
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
[HttpGet("current-user")]
|
||||
|
|
@ -48,7 +60,7 @@ public class MetaController(GuildCache guildCache, DiscordRequestService discord
|
|||
);
|
||||
}
|
||||
|
||||
private record MetaResponse(int Guilds);
|
||||
private record MetaResponse(int Guilds, string InviteUrl);
|
||||
|
||||
private record CurrentUserResponse(ApiUser User, IEnumerable<ApiGuild> Guilds);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue