mirror of
https://github.com/bitwarden/server
synced 2025-12-14 15:23:42 +00:00
Plan And Price Updates (#859)
* Expanded the Plan model to make plan & product data a bit more dynamic * Created a Product enum to track versioned instances of the same plan * Created and API call and Response model for getting plan & product data from the server
This commit is contained in:
21
src/Api/Controllers/PlansController.cs
Normal file
21
src/Api/Controllers/PlansController.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Bit.Core.Utilities;
|
||||
using Bit.Core.Models.Api;
|
||||
using System.Linq;
|
||||
|
||||
namespace Bit.Api.Controllers
|
||||
{
|
||||
[Route("plans")]
|
||||
[Authorize("Web")]
|
||||
public class PlansController : Controller
|
||||
{
|
||||
[HttpGet("")]
|
||||
public ListResponseModel<PlanResponseModel> Get()
|
||||
{
|
||||
var data = StaticStore.Plans;
|
||||
var responses = data.Select(plan => new PlanResponseModel(plan));
|
||||
return new ListResponseModel<PlanResponseModel>(responses);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user