diff --git a/Wonky.Client/Components/AppVersion.razor b/Wonky.Client/Components/AppVersion.razor index dd347ab2..35f93016 100644 --- a/Wonky.Client/Components/AppVersion.razor +++ b/Wonky.Client/Components/AppVersion.razor @@ -17,7 +17,7 @@ @Name @Version@if(IsBeta){-beta} @code { - private const string Version = "0.2.33"; + private const string Version = "0.2.34"; private const string Name = "wwo"; private const bool IsBeta = true; } diff --git a/Wonky.Client/Pages/CrmActivityCreate.razor.cs b/Wonky.Client/Pages/CrmActivityCreate.razor.cs index 7f93e683..e89bca83 100644 --- a/Wonky.Client/Pages/CrmActivityCreate.razor.cs +++ b/Wonky.Client/Pages/CrmActivityCreate.razor.cs @@ -37,6 +37,7 @@ public partial class CrmActivityCreate : IDisposable [Inject] private ICompanyHttpRepository CompanyRepo { get; set; } [Inject] private HttpInterceptorService Interceptor { get; set; } [Inject] private UserPreferenceService UserPrefs { get; set; } + [Inject] private IActivityHttpRepository ActivityRepo { get; set; } [CascadingParameter] DraftStateProvider DraftStateProvider { get; set; } [Parameter] public string CompanyId { get; set; } private NgSalesItemView _selectedItem { get; set; } = new(); @@ -137,8 +138,10 @@ public partial class CrmActivityCreate : IDisposable { _poDraft.Lines.Add(line); } - await StorageService.SetItemAsync(CompanyId, _poDraft); - //ToastService.ShowSuccess($"Aktivitet oprettet."); + //await StorageService.SetItemAsync(CompanyId, _poDraft); + await ActivityRepo.CreateActivity(_poDraft); + ToastService.ShowSuccess($"Godt så! Aktivitet oprettet for {_poDraft.Name}."); + NavigationManager.NavigateTo($"/companies"); } private void CheckActivity() diff --git a/Wonky.Client/Program.cs b/Wonky.Client/Program.cs index 09fd3ae1..3535b9b0 100644 --- a/Wonky.Client/Program.cs +++ b/Wonky.Client/Program.cs @@ -49,6 +49,7 @@ builder.Services.Configure(builder.Configuration.GetSection("ApiConfi builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddBlazoredLocalStorage(); diff --git a/Wonky.Client/Services/VatInfoLookupService.cs b/Wonky.Client/Services/VatInfoLookupService.cs index 82fe951f..c1df70bc 100644 --- a/Wonky.Client/Services/VatInfoLookupService.cs +++ b/Wonky.Client/Services/VatInfoLookupService.cs @@ -48,7 +48,7 @@ public class VatInfoLookupService ["houseNumber"] = query.HouseNumber, ["zipCode"] = query.ZipCode }; - var endpoint = QueryHelpers.AddQueryString(_apiConfig.Value.CvrLookup , queryString); + var endpoint = QueryHelpers.AddQueryString(_apiConfig.Value.CvrLookup, queryString); var response = await _client.GetAsync(endpoint); var content = await response.Content.ReadAsStringAsync(); diff --git a/Wonky.Client/wwwroot/appsettings.json b/Wonky.Client/wwwroot/appsettings.json index f4af2b20..571b106b 100644 --- a/Wonky.Client/wwwroot/appsettings.json +++ b/Wonky.Client/wwwroot/appsettings.json @@ -7,13 +7,14 @@ } }, "apiConfig": { - "baseAddress": "https://staging.innotec.dk", + "baseAddress": "https://app.innotec.dk", "tokenPath": "token", "userInfo": "api/auth/userinfo", - "crmCompanies": "api/v2/crm/companies", - "priceCatalog": "api/v2/crm/catalog", - "cvrLookup": "/api/v2/services/virk", + "customerEndpoint": "api/v2/crm/companies", + "catalogEndpoint": "api/v2/crm/catalog", + "cvrLookup": "api/v2/services/virk", "glsTrackUrl": "https://www.gls-group.eu/276-I-PORTAL-WEB/content/GLS/DK01/DA/5004.htm?txtAction=71000&txtRefNo=", - "glsId": "" + "glsId": "", + "activityEndpoint": "api/v2/crm/salesreps/sales" } } \ No newline at end of file diff --git a/Wonky.Entity/Configuration/ApiConfig.cs b/Wonky.Entity/Configuration/ApiConfig.cs index f30c79dc..1dcc79de 100644 --- a/Wonky.Entity/Configuration/ApiConfig.cs +++ b/Wonky.Entity/Configuration/ApiConfig.cs @@ -19,8 +19,8 @@ public class ApiConfig public string BaseAddress { get; set; } = ""; public string CustomerEndpoint { get; set; } = ""; public string CatalogEndpoint { get; set; } = ""; - public string KrvVariantEndpoint { get; set; } = ""; - public string KrvProductEndpoint { get; set; } = ""; + public string KrvVariants { get; set; } = ""; + public string KrvProducts { get; set; } = ""; public string ImageUpload { get; set; } = ""; public string UserRegistration { get; set; } = ""; public string UserInfo { get; set; } = "";