mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
Keypad: Show recent transactions only when logged in (#5534)
Fixes #5530. For the use case of giving access to cashiers we need to find another solution than showing the recent transactions for signed out users.
This commit is contained in:
@@ -523,7 +523,7 @@ namespace BTCPayServer.Plugins.PointOfSale.Controllers
|
|||||||
return View("Views/UIForms/View", viewModel);
|
return View("Views/UIForms/View", viewModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Authorize(Policy = Policies.CanModifyStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Cookie)]
|
[Authorize(Policy = Policies.CanViewInvoices, AuthenticationSchemes = AuthenticationSchemes.Cookie)]
|
||||||
[HttpGet("/apps/{appId}/pos/recent-transactions")]
|
[HttpGet("/apps/{appId}/pos/recent-transactions")]
|
||||||
public async Task<IActionResult> RecentTransactions(string appId)
|
public async Task<IActionResult> RecentTransactions(string appId)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
@using BTCPayServer.Client
|
||||||
@model BTCPayServer.Plugins.PointOfSale.Models.ViewPointOfSaleViewModel
|
@model BTCPayServer.Plugins.PointOfSale.Models.ViewPointOfSaleViewModel
|
||||||
|
|
||||||
<form id="app" method="post" asp-action="ViewPointOfSale" asp-route-appId="@Model.AppId" asp-antiforgery="false" v-on:submit="handleFormSubmit" class="d-flex flex-column gap-4 my-auto" v-cloak>
|
<form id="app" method="post" asp-action="ViewPointOfSale" asp-route-appId="@Model.AppId" asp-antiforgery="false" v-on:submit="handleFormSubmit" class="d-flex flex-column gap-4 my-auto" v-cloak>
|
||||||
@@ -89,7 +90,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="btn btn-link p-1" data-bs-toggle="modal" data-bs-target="#RecentTransactions" id="RecentTransactionsToggle">
|
<button type="button" class="btn btn-link p-1" data-bs-toggle="modal" data-bs-target="#RecentTransactions" id="RecentTransactionsToggle" permission="@Policies.CanViewInvoices">
|
||||||
<vc:icon symbol="manage-plugins"/>
|
<vc:icon symbol="manage-plugins"/>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -131,11 +131,16 @@ document.addEventListener("DOMContentLoaded",function () {
|
|||||||
async loadRecentTransactions() {
|
async loadRecentTransactions() {
|
||||||
this.recentTransactionsLoading = true;
|
this.recentTransactionsLoading = true;
|
||||||
const { url } = this.$refs.RecentTransactions.dataset;
|
const { url } = this.$refs.RecentTransactions.dataset;
|
||||||
const response = await fetch(url);
|
try {
|
||||||
if (response.ok) {
|
const response = await fetch(url);
|
||||||
this.recentTransactions = await response.json();
|
if (response.ok) {
|
||||||
|
this.recentTransactions = await response.json();
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
} finally {
|
||||||
|
this.recentTransactionsLoading = false;
|
||||||
}
|
}
|
||||||
this.recentTransactionsLoading = false;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|||||||
Reference in New Issue
Block a user