Skip to content

Commit

Permalink
Api URL to AppSettings,
Browse files Browse the repository at this point in the history
Fix height of card
  • Loading branch information
MD-V committed Nov 12, 2021
1 parent 6886e75 commit 048ffe7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Pages/Components/ParticipantSignInPlaceComponent.razor
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@if (SignInPlace.Participant != null)
{
<div class="flex-shrink-0">
<img class="card-img" src="@SignInPlace.Participant.User.Avatar" alt="@SignInPlace.Participant.User.Steamname" width="56" height="56">
<img class="card-img" src="@SignInPlace.Participant.User.Avatar" alt="@SignInPlace.Participant.User.Steamname" width="64" height="64" >
</div>
<div class="flex-grow-1 overflow-hidden text-start m-2">
<p class="m-0 text-nobreak text-nowrap text-truncate">@SignInPlace.Participant.User.Firstname @SignInPlace.Participant.User.Surname</p>
Expand All @@ -32,6 +32,7 @@
{
<div class="flex-grow-1 overflow-hidden text-start m-2">
<p class="m-0 text-nobreak text-nowrap text-truncate">Nicht belegt</p>
<p class="m-0 text-muted text-nobreak text-nowrap text-truncate">&nbsp;</p>
</div>
}
</div>
Expand All @@ -51,7 +52,6 @@
</div>
</div>


<div class="row">
<div class="col mb-3">
<input type="checkbox" class="btn-check" id="[email protected]" @bind="IsPaid" disabled="@IsPaidDisabled">
Expand Down
2 changes: 1 addition & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

builder.Services.AddHttpClient(nameof(EventulaApiService), client =>
{
client.BaseAddress = new System.Uri("https://lan2play.de");
client.BaseAddress = new System.Uri(builder.Configuration.GetValue<string>("EventulaApiBaseAddress"));
}).ConfigurePrimaryHttpMessageHandler(sp =>
{
var cookieContainer = sp.GetRequiredService<CookieContainer>();
Expand Down
12 changes: 6 additions & 6 deletions Services/EventulaApiService.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
using EventulaEntranceClient.Models;
using Microsoft.Extensions.Logging;
using System;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text.Json;
using System.Threading.Tasks;

namespace EventulaEntranceClient.Services
{
Expand Down Expand Up @@ -42,7 +37,9 @@ public async Task<TicketRequest> RequestTicket(string qrCode)
SetDefaultHeaders(httpClient, await _EventulaTokenService.RetrieveTokenAsync());

var getResult = await httpClient.GetAsync(string.Format(_UserApiParticipantUrl, qrCode.Split('/').Last()));


getResult.EnsureSuccessStatusCode();

var content = await getResult.Content.ReadAsStringAsync();

var ticketRequest = JsonSerializer.Deserialize<TicketRequest>(content, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
Expand All @@ -59,6 +56,9 @@ public async Task<TicketRequest> SignInParticipant(Participant participant)
SetDefaultHeaders(httpClient, await _EventulaTokenService.RetrieveTokenAsync());

var getResult = await httpClient.GetAsync(string.Format(_UserApiParticipantSignInUrl, participant.Id));

getResult.EnsureSuccessStatusCode();

var content = await getResult.Content.ReadAsStringAsync();

var ticketRequest = JsonSerializer.Deserialize<TicketRequest>(content, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
Expand Down
3 changes: 2 additions & 1 deletion appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
}
},
"AllowedHosts": "*",
"PinSha256": "c50281c3dd92d836d2ba7702fad19f778404cddd49059afc7b2e6e537f436ea7"
"PinSha256": "c50281c3dd92d836d2ba7702fad19f778404cddd49059afc7b2e6e537f436ea7",
"EventulaApiBaseAddress": "https://lan2play.de"
}

0 comments on commit 048ffe7

Please sign in to comment.