29 lines
590 B
C#
29 lines
590 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using System.Text.Json;
|
|
using TSC2.Components.CSharp;
|
|
|
|
namespace TSC2.Components.Controllers
|
|
{
|
|
[ApiController]
|
|
[Route("api")]
|
|
public class ReviewController : Controller
|
|
{
|
|
[HttpGet("GetShopReviews")]
|
|
public IEnumerable<string> GetReviews(string shopID)
|
|
{
|
|
var reviews = DatabaseManager.GetShopReviews(shopID).ToArray();
|
|
|
|
|
|
return reviews;
|
|
}
|
|
|
|
|
|
[HttpGet("GetShopReviewScores")]
|
|
public IEnumerable<int> GetReviewScores(string shopID)
|
|
{
|
|
var scores = DatabaseManager.GetShopReviewScores(shopID).ToArray();
|
|
return scores;
|
|
}
|
|
}
|
|
}
|