Skip to content

Commit

Permalink
Refactor API settings access in Definition.razor
Browse files Browse the repository at this point in the history
Removed the ApiSettings class from the BlazorBasic namespace, which previously contained various API settings properties. Updated the OnParametersSetAsync method in Definition.razor to access configuration settings directly by their keys instead of using the ApiSettings section.
  • Loading branch information
madebygps committed Sep 16, 2024
1 parent 7274df6 commit 57b3324
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
14 changes: 0 additions & 14 deletions Client/ApiSettings.cs

This file was deleted.

12 changes: 6 additions & 6 deletions Client/Pages/Definition.razor
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ protected override async Task OnParametersSetAsync()



var apiBaseUrl = Configuration["ApiSettings:BaseUrl"];
var projectGeneratorBaseUrl = Configuration["ApiSettings:ProjectGeneratorBaseUrl"];
var projectGeneratorApiKey = Configuration["ApiSettings:ProjectGeneratorApiKey"];
var definitionApiKey = Configuration["ApiSettings:DefinitionApiKey"];
var tagApiKey = Configuration["ApiSettings:TagApiKey"];
var projectApiKey = Configuration["ApiSettings:ProjectApiKey"];
var apiBaseUrl = Configuration["BaseUrl"];
var projectGeneratorBaseUrl = Configuration["ProjectGeneratorBaseUrl"];
var projectGeneratorApiKey = Configuration["ProjectGeneratorApiKey"];
var definitionApiKey = Configuration["DefinitionApiKey"];
var tagApiKey = Configuration["TagApiKey"];
var projectApiKey = Configuration["ProjectApiKey"];

// GetDefinitionByWord
var definitionResponse = await Http.GetAsync($"{apiBaseUrl}/GetDefinitionByWord?code={definitionApiKey}&word={Word}");
Expand Down

0 comments on commit 57b3324

Please sign in to comment.