diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 57cf164..a1485cc 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "fable": { - "version": "5.5.0", + "version": "5.6.0", "commands": [ "fable" ], diff --git a/src/Bridge/Services/Clients/BranchClient.fs b/src/Bridge/Services/Clients/BranchClient.fs index 95b51bf..29e694d 100644 --- a/src/Bridge/Services/Clients/BranchClient.fs +++ b/src/Bridge/Services/Clients/BranchClient.fs @@ -17,8 +17,9 @@ type BranchClient(transport: IHttpTransport) = for id in ids do yield "id", (id: UrlPart) | _ -> () - if not (String.IsNullOrEmpty(queryParams.search)) then - yield "search", (queryParams.search: UrlPart) + match Option.ofObj queryParams.search with + | Some search when not (String.IsNullOrEmpty(search)) -> yield "search", (search: UrlPart) + | _ -> () if queryParams.pageNumber.HasValue then yield "pageNumber", (queryParams.pageNumber.Value: UrlPart) if queryParams.pageSize.HasValue then diff --git a/src/Bridge/Services/Clients/DepartmentClient.fs b/src/Bridge/Services/Clients/DepartmentClient.fs index 4d3132c..58da162 100644 --- a/src/Bridge/Services/Clients/DepartmentClient.fs +++ b/src/Bridge/Services/Clients/DepartmentClient.fs @@ -17,8 +17,9 @@ type DepartmentClient(transport: IHttpTransport) = for id in ids do yield "id", (id: UrlPart) | _ -> () - if not (String.IsNullOrEmpty(queryParams.search)) then - yield "search", (queryParams.search: UrlPart) + match Option.ofObj queryParams.search with + | Some search when not (String.IsNullOrEmpty(search)) -> yield "search", (search: UrlPart) + | _ -> () if queryParams.pageNumber.HasValue then yield "pageNumber", (queryParams.pageNumber.Value: UrlPart) if queryParams.pageSize.HasValue then diff --git a/src/Bridge/Services/Clients/EmployeeClient.fs b/src/Bridge/Services/Clients/EmployeeClient.fs index 2660db7..eae9e95 100644 --- a/src/Bridge/Services/Clients/EmployeeClient.fs +++ b/src/Bridge/Services/Clients/EmployeeClient.fs @@ -17,8 +17,9 @@ type EmployeeClient(transport: IHttpTransport) = for id in ids do yield "id", (id: UrlPart) | _ -> () - if not (String.IsNullOrEmpty(queryParams.search)) then - yield "search", (queryParams.search: UrlPart) + match Option.ofObj queryParams.search with + | Some search when not (String.IsNullOrEmpty(search)) -> yield "search", (search: UrlPart) + | _ -> () if queryParams.pageNumber.HasValue then yield "pageNumber", (queryParams.pageNumber.Value: UrlPart) if queryParams.pageSize.HasValue then @@ -33,8 +34,9 @@ type EmployeeClient(transport: IHttpTransport) = let buildPagingUrl (queryParams: EmployeePagingRequestModel) = let parameters = - [ if not (String.IsNullOrEmpty(queryParams.search)) then - yield "search", (queryParams.search: UrlPart) + [ match Option.ofObj queryParams.search with + | Some search when not (String.IsNullOrEmpty(search)) -> yield "search", (search: UrlPart) + | _ -> () if queryParams.pageNumber.HasValue then yield "pageNumber", (queryParams.pageNumber.Value: UrlPart) if queryParams.pageSize.HasValue then diff --git a/src/Bridge/Services/UrlHelpers.fs b/src/Bridge/Services/UrlHelpers.fs index ced0f77..e035906 100644 --- a/src/Bridge/Services/UrlHelpers.fs +++ b/src/Bridge/Services/UrlHelpers.fs @@ -2,6 +2,7 @@ module Fossa.Bridge.Services.UrlHelpers open System +open System.Globalization let private suffixMappings = [ ".dev.localhost:4211", ".dev.localhost:5210" @@ -39,7 +40,8 @@ type UrlPart(value: string) = static member op_Implicit(dt: DateTime) = UrlPart(string dt) - static member op_Implicit(dto: DateTimeOffset) = UrlPart(string dto) + static member op_Implicit(dto: DateTimeOffset) = + UrlPart(dto.ToString("O", CultureInfo.InvariantCulture)) let composeRelativeUrl (endpointUrl: string)