From aa966aaa83855037fbae4f4e984030d40375c0b3 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 10 Nov 2016 01:02:57 +0100 Subject: [PATCH] POST required to generate the Pdf resource --- Yavsc/ApiControllers/PdfEstimateController.cs | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/Yavsc/ApiControllers/PdfEstimateController.cs b/Yavsc/ApiControllers/PdfEstimateController.cs index 3ace640d..10ba682e 100644 --- a/Yavsc/ApiControllers/PdfEstimateController.cs +++ b/Yavsc/ApiControllers/PdfEstimateController.cs @@ -76,36 +76,16 @@ namespace Yavsc.ApiControllers return File(fi.OpenRead(), "application/x-pdf", filename); ; } - [HttpGet("GetComponents", Name = "GetComponents")] - public IActionResult GetComponents() - { - return Ok(provider); - } - [HttpGet("estimate-{id}.tex", Name = "GetTex"), Authorize] public IActionResult GetTex(long id) { Response.ContentType = "text/x-tex"; - return ViewComponent("Estimate",new object[] { id, false }); } - [HttpGet("gen/{id}")] + [HttpPost("gen/{id}")] public async Task GeneratePdf(long id) { - /* - - using (TextWriter wr = new StringWriter()) { - ViewComponentContext ctx = new ViewComponentContext( - selector.SelectComponent("Estimate"), new object[]{id}, - new ViewContext(), - wr - ); - - } - - */ - return ViewComponent("Estimate",new object[] { id, true } ); } }