diff --git a/Wonky.Client/Components/WorkplaceListComponent.razor b/Wonky.Client/Components/WorkplaceListComponent.razor new file mode 100644 index 00000000..50175aa8 --- /dev/null +++ b/Wonky.Client/Components/WorkplaceListComponent.razor @@ -0,0 +1,40 @@ +@using Wonky.Entity.DTO +@using Wonky.Entity.Views + +@if (Workplaces.Any()) +{ +
+
+
+ Arbejdssted +
+
+ Note +
+
+ @foreach (var workplace in Workplaces) + { + +
+
+ @workplace.Name +
+
+ @workplace.Description +
+
+
+ } +
+} +else +{ +
Ingen data
+} + +@code { + + [Parameter] public List Workplaces { get; set; } = new(); + + [Parameter] public string CompanyId { get; set; } = ""; +} \ No newline at end of file diff --git a/Wonky.Client/Pages/WorkplaceListPage.razor b/Wonky.Client/Pages/WorkplaceListPage.razor index 863cca59..eb561490 100644 --- a/Wonky.Client/Pages/WorkplaceListPage.razor +++ b/Wonky.Client/Pages/WorkplaceListPage.razor @@ -16,26 +16,15 @@ *@ @using Microsoft.AspNetCore.Authorization +@using Wonky.Client.Components @attribute [Authorize(Roles = "Advisor")] @page "/companies/{CompanyId}/workplaces" -
-
-
-

@_company.Name

-
-
-
- @if (_workplaces.Any()) - { - - } +
+
+

@_company.Name

+
+
+
\ No newline at end of file diff --git a/Wonky.Client/Pages/WorkplaceListPage.razor.cs b/Wonky.Client/Pages/WorkplaceListPage.razor.cs index 524c5533..04817040 100644 --- a/Wonky.Client/Pages/WorkplaceListPage.razor.cs +++ b/Wonky.Client/Pages/WorkplaceListPage.razor.cs @@ -37,9 +37,11 @@ public partial class WorkplaceListPage : IDisposable _interceptor.RegisterEvent(); _interceptor.RegisterBeforeSendEvent(); _company = await _companyRepo.GetCompanyById(CompanyId); + } + + protected override async Task OnInitializedAsync() + { _workplaces = await _workplaceRepo.GetWorkplaces(CompanyId); - - Console.WriteLine(JsonSerializer.Serialize(_workplaces)); } public void Dispose() diff --git a/Wonky.Client/wwwroot/appsettings.json b/Wonky.Client/wwwroot/appsettings.json index 5e882a85..ddd18cdd 100644 --- a/Wonky.Client/wwwroot/appsettings.json +++ b/Wonky.Client/wwwroot/appsettings.json @@ -7,7 +7,7 @@ "image": "grumpy-coder.png" }, "apiConfig": { - "innoBaseUrl": "https://app.innotec.dk", + "innoBaseUrl": "https://staging.innotec.dk", "glsTrackUrl": "https://www.gls-group.eu/276-I-PORTAL-WEB/content/GLS/DK01/DA/5004.htm?txtAction=71000&txtRefNo=", "glsId": "", "serviceVirk": "api/v2/services/virk",