Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions Core/Resgrid.Services/SubscriptionsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -631,12 +631,15 @@ public async Task<List<PaymentAddon>> GetCurrentPaymentAddonsForDepartmentAsync(
{
if (!String.IsNullOrWhiteSpace(Config.SystemBehaviorConfig.BillingApiBaseUrl) && !String.IsNullOrWhiteSpace(Config.ApiConfig.BackendInternalApikey))
{
if (planAddonIds == null || planAddonIds.Count == 0)
return new List<PaymentAddon>();

var client = new RestClient(Config.SystemBehaviorConfig.BillingApiBaseUrl, configureSerialization: s => s.UseNewtonsoftJson());
var request = new RestRequest($"/api/Billing/GetCurrentPaymentAddonsForDepartment", Method.Get);
var request = new RestRequest($"/api/Billing/GetCurrentPaymentAddonsForDepartmentPost", Method.Post);
request.AddHeader("X-API-Key", Config.ApiConfig.BackendInternalApikey);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("departmentId", departmentId, ParameterType.QueryString);
request.AddParameter("planAddonIds", planAddonIds.ToString(), ParameterType.QueryString);
request.AddHeader("Content-Type", "application/json; charset=utf-8");
//request.AddParameter("departmentId", departmentId, ParameterType.QueryString);
request.AddBody(new { DepartmentId = departmentId, PlanAddonIds = planAddonIds.ToArray() });

var response = await client.ExecuteAsync<GetAllPaymentAddonsForDepartmentResult>(request);

Expand Down Expand Up @@ -680,7 +683,7 @@ public async Task<List<PlanAddon>> GetAllAddonPlansByTypeAsync(PlanAddonTypes pl
var request = new RestRequest($"/api/Billing/GetAllAddonPlansByType", Method.Get);
request.AddHeader("X-API-Key", Config.ApiConfig.BackendInternalApikey);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("planAddonType", planAddonType, ParameterType.QueryString);
request.AddParameter("type", (int)planAddonType, ParameterType.QueryString);

var response = await client.ExecuteAsync<GetAllPlanAddonsByTypeResult>(request);

Expand Down
12 changes: 0 additions & 12 deletions Web/Resgrid.Web.Services/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,12 @@
using Resgrid.Web.Services.Models;
using Microsoft.EntityFrameworkCore;
using static OpenIddict.Abstractions.OpenIddictConstants;
using Microsoft.IdentityModel.Tokens;
using OpenTelemetry;
using OpenTelemetry.Exporter;
using OpenTelemetry.Instrumentation.AspNetCore;
//using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using OpenIddict.Abstractions;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Swashbuckle.AspNetCore.Swagger;
using System.Security.Cryptography.X509Certificates;
using Resgrid.Web.Services;
using Microsoft.ApplicationInsights.AspNetCore.Extensions;
using Microsoft.ApplicationInsights.Extensibility;
using Sentry.Extensibility;
using Resgrid.Web.ServicesCore.Middleware;
using IPNetwork = Microsoft.AspNetCore.HttpOverrides.IPNetwork;
using OpenTelemetry.Metrics;
using System.Net.Http;
using Resgrid.Providers.Messaging;

Expand Down
29 changes: 16 additions & 13 deletions Web/Resgrid.Web/Areas/User/Views/Home/EditUserProfile.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -529,23 +529,26 @@
</div>
</div>
</div>
<div class="ibox">
<div class="ibox-title">
<h5>@localizer["DeleteUserAccount"]</h5>
</div>
<div class="ibox-content">
<div class='row'>
<div class="col-md-12">
<p>@localizer["DeleteUserAccountInfo"]</p>
</div>
@if (Model.IsOwnProfile)
{
<div class="ibox">
<div class="ibox-title">
<h5>@localizer["DeleteUserAccount"]</h5>
</div>
<div class="form-group">
<div class="col-sm-12">
<a class="btn btn-w-m btn-block btn-danger" asp-controller="Account" asp-action="DeleteAccount" asp-route-area="User">@localizer["DeleteUserAccount"]</a>
<div class="ibox-content">
<div class='row'>
<div class="col-md-12">
<p>@localizer["DeleteUserAccountInfo"]</p>
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<a class="btn btn-w-m btn-block btn-danger" asp-controller="Account" asp-action="DeleteAccount" asp-route-area="User">@localizer["DeleteUserAccount"]</a>
</div>
</div>
</div>
</div>
</div>
}
</div>
</div>
</div>
Expand Down
Loading