AppSettings.ApiUrl
This commit is contained in:
@ -9,6 +9,7 @@ public partial class RunInfo
|
||||
[Parameter] public Metrology.Shared.ViewModels.RunInfo? Model { get; set; }
|
||||
|
||||
[Inject] protected IJSRuntime? JSRuntime { get; set; }
|
||||
[Inject] protected Models.AppSettings? AppSettings { get; set; }
|
||||
|
||||
protected override Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
@ -16,10 +17,12 @@ public partial class RunInfo
|
||||
{
|
||||
if (JSRuntime is null)
|
||||
throw new NullReferenceException(nameof(JSRuntime));
|
||||
if (AppSettings is null)
|
||||
throw new NullReferenceException(nameof(AppSettings));
|
||||
int initialToolTypeID = Model is not null ? Model.ToolTypeID : 0;
|
||||
int initialHeaderId = Model is not null ? Model.HeaderID : 0;
|
||||
string initialHeaderAttachmentId = Model is not null ? Model.HeaderAttachmentID.ToString() : string.Empty;
|
||||
return JSRuntime.InvokeVoidAsync("initRunInfo", initialToolTypeID, initialHeaderId, initialHeaderAttachmentId).AsTask();
|
||||
return JSRuntime.InvokeVoidAsync("initRunInfo", AppSettings.ApiUrl, initialToolTypeID, initialHeaderId, initialHeaderAttachmentId).AsTask();
|
||||
}
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
Reference in New Issue
Block a user