Skip to content

Commit

Permalink
Fixed uri.
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelcanosantana committed Nov 26, 2023
1 parent 5f301ac commit b85b4ee
Showing 1 changed file with 6 additions and 44 deletions.
50 changes: 6 additions & 44 deletions Pages/Dashboard.razor
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="col-12 col-md-6">
<h3 class="fw-bold"> Afiliación </h3>
<p>
Personaliza tu página de afiliado, compártela con los clientes a través del siguiente enlace
Personaliza tu página de afiliado, compártela con los clientes a través del siguiente enlace.
</p>
</div>

Expand All @@ -25,7 +25,7 @@

<div class="mb-3">
<label for="exampleInputEmail1" class="form-label">Link de afiliado</label>
<input value="@NavigationManager.ToAbsoluteUri("/dashboard/aff/")@UserService.GetLoggedUser().GetId()" class="form-control" id="nameInput" readonly>
<input value="@GetAbsoluteUri()" class="form-control" id="nameInput" readonly>
</div>

</form>
Expand All @@ -38,51 +38,13 @@
</div>


@if (forecasts == null)
{
<p><em>Loading...</em></p>
}
else
{
<table class="table">
<thead>
<tr>
<th>Date</th>
<th>Temp. (C)</th>
<th>Temp. (F)</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
@foreach (var forecast in forecasts)
{
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
</tr>
}
</tbody>
</table>
}

@code {
private WeatherForecast[]? forecasts;

protected override async Task OnInitializedAsync()
{
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("sample-data/weather.json");
}
private String absoluteUri = "";

Check warning on line 43 in Pages/Dashboard.razor

View workflow job for this annotation

GitHub Actions / deploy-to-github-pages

The field 'Dashboard.absoluteUri' is assigned but its value is never used

public class WeatherForecast
{
public DateOnly Date { get; set; }

public int TemperatureC { get; set; }

public string? Summary { get; set; }

public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
private String GetAbsoluteUri()
{
return NavigationManager.ToAbsoluteUri("/dashboard/aff/").ToString() + @UserService.GetLoggedUser().GetId();

Check warning on line 48 in Pages/Dashboard.razor

View workflow job for this annotation

GitHub Actions / deploy-to-github-pages

Dereference of a possibly null reference.
}
}

0 comments on commit b85b4ee

Please sign in to comment.