Files
Partsource/PartSource.Api/Controllers/TemplatesController.cs
2020-04-12 20:52:03 -04:00

41 lines
1.1 KiB
C#

using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace PartSource.Api.Controllers
{
[Route("[controller]")]
[ApiController]
public class TemplatesController : ControllerBase
{
[Route("{templateName}/{vehicleId}")]
[HttpGet]
public IActionResult GetTemplate(string templateName, int vehicleId)
{
StringValues contentType = new StringValues("application/liquid");
Response.Headers.Add("Content-Type", contentType);
string content = $"{templateName},{vehicleId}";
return Ok(content);
}
//Crappy oauth code to make the app installable on shopify
//HttpRequest request = HttpContext.Request;
//string location = "https://ratermaniac.myshopify.com/admin/oauth/authorize?client_id=097de154602f28499e058f66b8653033&scope=read_customers&redirect_uri=https://soundpress.com&state=0.4585849384";
//StringValues locationHeader = new StringValues(location);
// //Response.Headers.Add("Location", location);
// return Redirect(location);
}
}