Fix problem with ulongs on frontend... js does not handle them... at all
This commit is contained in:
parent
818f71c75a
commit
7c4d007863
@ -30,7 +30,9 @@ namespace ChaosBot.WebServer.App
|
|||||||
.Where(cc => cc.DiscordGuildId == guildId)
|
.Where(cc => cc.DiscordGuildId == guildId)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
return Json(customCommands);
|
List<CustomCommandResponse> response = customCommands.Select(e => new CustomCommandResponse(e)).ToList();
|
||||||
|
|
||||||
|
return Json(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
|||||||
26
ChaosBot/WebServer/Models/CustomCommandResponse.cs
Normal file
26
ChaosBot/WebServer/Models/CustomCommandResponse.cs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using ChaosBot.Models;
|
||||||
|
|
||||||
|
namespace ChaosBot.WebServer.Models
|
||||||
|
{
|
||||||
|
class CustomCommandResponse
|
||||||
|
{
|
||||||
|
[Required]
|
||||||
|
public string DiscordGuildId { get; }
|
||||||
|
[Required]
|
||||||
|
[MaxLength(128)]
|
||||||
|
public string Command { get; }
|
||||||
|
[Required]
|
||||||
|
public CustomCommandType Type { get; }
|
||||||
|
[Required]
|
||||||
|
public string Content { get; }
|
||||||
|
|
||||||
|
public CustomCommandResponse(CustomCommand command)
|
||||||
|
{
|
||||||
|
DiscordGuildId = command.DiscordGuildId.ToString();
|
||||||
|
Command = command.Command;
|
||||||
|
Type = command.Type;
|
||||||
|
Content = command.Content;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user