Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/bb-io/XTM into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
bZverok committed Apr 16, 2024
2 parents e771375 + 53b2c43 commit b6aea26
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Apps.XTM/Apps.XTM.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Product>XTM</Product>
<Version>3.1.3</Version>
<Version>3.1.4</Version>
<Description>Translation management system that centralizes localization assets and enables fast, accurate translation and deployment of content tailored to any audience in any territory</Description>
<AssemblyName>Apps.XTM</AssemblyName>
<LangVersion>12</LangVersion>
Expand Down
9 changes: 9 additions & 0 deletions Apps.XTM/Extensions/CredsExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,13 @@ public static string GetInstanceUrl(this IEnumerable<AuthenticationCredentialsPr
return creds.FirstOrDefault(x => x.KeyName == CredsNames.Url)
?.Value ?? string.Empty;
}

public static string GetUrl(this IEnumerable<AuthenticationCredentialsProvider> creds)
{
var url = creds.Get(CredsNames.Url).TrimEnd('/');
if(url.Contains("/project-manager-api-rest"))
return url;

return url + "/project-manager-api-rest";
}
}
4 changes: 2 additions & 2 deletions Apps.XTM/RestUtilities/XTMClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public async Task<RestResponse> ExecuteXtmWithJson(string endpoint, Method metho

var request = new XTMRequest(new()
{
Url = creds.Get(CredsNames.Url) + endpoint,
Url = creds.GetUrl() + endpoint,
Method = method
}, token);

Expand Down Expand Up @@ -88,7 +88,7 @@ public async Task<T> ExecuteXtm<T>(XTMRequest request)

public async Task<string> GetToken(AuthenticationCredentialsProvider[] creds)
{
var url = creds.Get(CredsNames.Url);
var url = creds.GetUrl();

var client = creds.Get(CredsNames.Client);
var userId = creds.Get(CredsNames.UserId);
Expand Down

0 comments on commit b6aea26

Please sign in to comment.