POST required to generate the Pdf resource
This commit is contained in:
parent
53c32969c1
commit
04678995f3
1 changed files with 1 additions and 21 deletions
|
|
@ -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<IActionResult> 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 } );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue