Pre-firebase switch, use same registration scaffolding

This commit is contained in:
Fergal Moran
2018-03-26 18:35:24 +01:00
parent 58d915a0e0
commit 30b0959416
9 changed files with 118 additions and 104 deletions

View File

@@ -7,7 +7,7 @@ using PodNoms.Api.Services.Push.Models;
namespace PodNoms.Api.Controllers {
[Authorize]
// [Authorize]
[Route("[controller]")]
public class WebPushController : Controller {
private readonly IPushSubscriptionStore _subscriptionStore;
@@ -17,7 +17,7 @@ namespace PodNoms.Api.Controllers {
this._subscriptionStore = subscriptionStore;
this._notificationService = notificationService;
}
[HttpPost("subscribe")]
public async Task<IActionResult> StoreSubscription([FromBody]PushSubscription subscription) {
await _subscriptionStore.StoreSubscriptionAsync(subscription);
@@ -25,7 +25,7 @@ namespace PodNoms.Api.Controllers {
}
// POST push-notifications-api/notifications
[HttpPost("notifications")]
[HttpPost("message")]
public async Task<IActionResult> SendNotification([FromBody]PushMessageViewModel message) {
PushMessage pushMessage = new PushMessage(message.Notification) {
Topic = message.Topic,