From b675e8b77bfdcadef1047042e18355ac4c2ad2bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=A8=D0=B8?= =?UTF-8?q?=D0=BC=D0=B0=D0=BD=D1=81=D0=BA=D0=B8=D0=B9?= Date: Thu, 16 Nov 2023 19:53:00 +0300 Subject: [PATCH] hotfix v2 --- Controllers/WeatherForecastController.cs | 6 +++--- Justice/Interactions/CitiesInteractions.cs | 4 ++-- Startup.cs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Controllers/WeatherForecastController.cs b/Controllers/WeatherForecastController.cs index 244e4e3..9093121 100644 --- a/Controllers/WeatherForecastController.cs +++ b/Controllers/WeatherForecastController.cs @@ -6,11 +6,11 @@ using System.Text.Json.Nodes; namespace DiscordApp.Controllers { [ApiController] - [Route("[controller]/")] + [Route("[controller]")] public class redirects : ControllerBase { - [HttpGet("redirects/{uri}")] + [HttpGet("/redirects/{uri}")] public IActionResult Get(string uri) { var data = Startup.appDbContext.Redirects.First(k => k.Id == uri); @@ -19,7 +19,7 @@ namespace DiscordApp.Controllers return Redirect(data.url); } - [HttpPost("addOnMap")] + [HttpPost("/addOnMap")] public ActionResult Create(string bodyContent) { JsonNode jsonBodyContent = JsonNode.Parse(bodyContent); diff --git a/Justice/Interactions/CitiesInteractions.cs b/Justice/Interactions/CitiesInteractions.cs index 0b55f83..90f6594 100644 --- a/Justice/Interactions/CitiesInteractions.cs +++ b/Justice/Interactions/CitiesInteractions.cs @@ -17,14 +17,14 @@ namespace DiscordApp.Justice.Interactions Amount = 16, Data = $"user:{Context.User.Id};channel:{Context.Channel.Id};", RedirectUrl = Context.Interaction.GetOriginalResponseAsync().Result.GetJumpUrl(), - WebHookUrl = "https://api.yawaflua.ru/addOnMap/" + WebHookUrl = "https://discord.yawaflua.ru/addOnMap/" }; var uri = await Startup.sp.InitPayment(paymentData); var redirectUri = Guid.NewGuid().ToString(); var redirectTable = new Redirects() { Id = redirectUri , url = uri}; Startup.appDbContext.Redirects.Add(redirectTable); Startup.appDbContext.SaveChanges(); - await FollowupAsync("Нажмите на кнопку ниже для оплаты", components: new ComponentBuilder().WithButton("Оплатить", url: $"https://api.yawaflua.ru/redirects/{redirectUri}", style: ButtonStyle.Link).Build());//, ephemeral: true); + await FollowupAsync("Нажмите на кнопку ниже для оплаты", components: new ComponentBuilder().WithButton("Оплатить", url: $"https://discord.yawaflua.ru/redirects/{redirectUri}", style: ButtonStyle.Link).Build());//, ephemeral: true); } diff --git a/Startup.cs b/Startup.cs index f0fe556..9d238ea 100644 --- a/Startup.cs +++ b/Startup.cs @@ -203,7 +203,7 @@ namespace DiscordApp } app.UseStaticFiles(); app.UseRouting(); - app.UseCors(k => { k.AllowAnyHeader(); k.AllowAnyMethod(); k.AllowAnyOrigin(); }); + app.UseCors(k => { k.AllowAnyHeader(); k.AllowAnyMethod(); k.AllowAnyOrigin(); k.WithMethods("POST", "GET"); }); app.UseEndpoints(endpoints => { endpoints.MapControllers();