Skip to content

Commit 3b064cf

Browse files
committed
Fix getting the label by division
1 parent fd0b49d commit 3b064cf

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

ProReception.DistributionServerInfrastructure/ProReceptionApi/ApiClientBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public async Task<TokensRecord> RefreshAndSaveTokens(TokensRecord tokensRecord)
7777
return await SaveTokensToSettings(response);
7878
}
7979

80-
protected async Task<T> Query<T>(Func<IFlurlRequest, Task<T>> getRequestFunc) =>
80+
public async Task<T> Query<T>(Func<IFlurlRequest, Task<T>> getRequestFunc) =>
8181
await _resiliencePipeline.ExecuteAsync(async _ =>
8282
{
8383
var baseRequest = await GetBaseRequestAsync();

ProReception.DistributionServerInfrastructure/ProReceptionApi/IProReceptionApiClient.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ public interface IProReceptionApiClient
1313
Task Patch(string path, object data);
1414
Task<IFlurlResponse> GetRaw(string path);
1515
Task<T> Post<T>(string path, object data);
16+
Task<T> Query<T>(Func<IFlurlRequest, Task<T>> getRequestFunc);
1617
}

ProReception.DistributionServerInfrastructure/ProReceptionApi/PrinterLabel/PrinterLabelExtensions.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,8 @@ public static class PrinterLabelExtensions
1919
{
2020
try
2121
{
22-
var url = new Flurl.Url("printer-label");
23-
if (divisionId.HasValue)
24-
{
25-
url.SetQueryParam("divisionId", divisionId.Value);
26-
}
27-
var response = await proReceptionApiClient.GetRaw(url.ToString());
22+
var response = await proReceptionApiClient.Query(req =>
23+
req.AppendPathSegment("printer-label").SetQueryParam("divisionId", divisionId).GetAsync());
2824

2925
return new LabelResponse
3026
{

version.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>2.2.0</Version>
3+
<Version>2.2.1</Version>
44
</PropertyGroup>
55
</Project>

0 commit comments

Comments
 (0)