From 4369d73325e4071a6f170cc6af24af03c64115c1 Mon Sep 17 00:00:00 2001 From: "Angel D. Munoz" Date: Sun, 3 Nov 2024 11:53:55 -0600 Subject: [PATCH] refactor: fix compilation issues --- Threads.Lib.Tests/Posts.fs | 1 + Threads.Lib.Tests/ReplyManagement.fs | 7 +++---- Threads.Lib/Media.fs | 3 ++- Threads.Lib/Pagination.fsi | 2 +- Threads.Lib/ReplyManagement.fs | 6 ++++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Threads.Lib.Tests/Posts.fs b/Threads.Lib.Tests/Posts.fs index fe16c0b..d080cb1 100644 --- a/Threads.Lib.Tests/Posts.fs +++ b/Threads.Lib.Tests/Posts.fs @@ -6,6 +6,7 @@ open Flurl.Util open Microsoft.VisualStudio.TestTools.UnitTesting open Flurl.Http.Testing +open Threads.Lib open Threads.Lib.Posts diff --git a/Threads.Lib.Tests/ReplyManagement.fs b/Threads.Lib.Tests/ReplyManagement.fs index 3777379..ee85da3 100644 --- a/Threads.Lib.Tests/ReplyManagement.fs +++ b/Threads.Lib.Tests/ReplyManagement.fs @@ -10,7 +10,6 @@ open Flurl.Http open Flurl.Http.Testing open Threads.Lib - open Threads.Lib.ReplyManagement @@ -182,7 +181,7 @@ type ReplyManagementTests() = ReplyFieldValue.Timestamp( DateTimeOffset.Parse("2024-01-01T18:20:00+0000") ) - ReplyFieldValue.MediaProductType Threads + ReplyFieldValue.MediaProductType MediaProductType.Threads ReplyFieldValue.MediaType TextPost ReplyFieldValue.MediaUrl(Uri("https://example.com")) ReplyFieldValue.Shortcode "abcdefg" @@ -285,7 +284,7 @@ type ReplyManagementTests() = ReplyFieldValue.Timestamp( DateTimeOffset.Parse("2024-01-01T18:20:00+0000") ) - ReplyFieldValue.MediaProductType Threads + ReplyFieldValue.MediaProductType MediaProductType.Threads ReplyFieldValue.MediaType TextPost ReplyFieldValue.Shortcode "abcdefg" ReplyFieldValue.HasReplies true @@ -377,7 +376,7 @@ type ReplyManagementTests() = ReplyFieldValue.Timestamp( DateTimeOffset.Parse("2024-01-01T18:20:00+0000") ) - ReplyFieldValue.MediaProductType Threads + ReplyFieldValue.MediaProductType MediaProductType.Threads ReplyFieldValue.MediaType TextPost ReplyFieldValue.Shortcode "abcdefg" ReplyFieldValue.HasReplies true diff --git a/Threads.Lib/Media.fs b/Threads.Lib/Media.fs index 20692fd..594e5d7 100644 --- a/Threads.Lib/Media.fs +++ b/Threads.Lib/Media.fs @@ -92,7 +92,8 @@ module Media = let decodeMediaProductType(get: Decode.IGetters, fields: _ ResizeArray) = match get.Optional.Field "media_product_type" Decode.string with - | Some "THREADS" -> ThreadValue.MediaProductType Threads |> fields.Add + | Some "THREADS" -> + ThreadValue.MediaProductType MediaProductType.Threads |> fields.Add | Some value -> () // new value added? | None -> () diff --git a/Threads.Lib/Pagination.fsi b/Threads.Lib/Pagination.fsi index b5d1ccd..e11dd7b 100644 --- a/Threads.Lib/Pagination.fsi +++ b/Threads.Lib/Pagination.fsi @@ -10,7 +10,7 @@ module internal IdLike = val Decode: Decoder -[] +[] type MediaProductType = | Threads module internal MediaProductType = diff --git a/Threads.Lib/ReplyManagement.fs b/Threads.Lib/ReplyManagement.fs index a2f9fef..d4ae87d 100644 --- a/Threads.Lib/ReplyManagement.fs +++ b/Threads.Lib/ReplyManagement.fs @@ -227,7 +227,8 @@ module ReplyManagement = get.Optional.Field "media_product_type" Decode.string |> Option.map(fun value -> match value with - | "THREADS" -> values.Add(ReplyFieldValue.MediaProductType Threads) + | "THREADS" -> + values.Add(ReplyFieldValue.MediaProductType MediaProductType.Threads) | other -> () // new value added? ) |> Option.defaultValue() @@ -246,7 +247,8 @@ module ReplyManagement = | "CAROUSEL_ALBUM" -> values.Add(ReplyFieldValue.MediaType CarouselAlbum) | "AUDIO" -> values.Add(ReplyFieldValue.MediaType Audio) - | "THREADS" -> values.Add(ReplyFieldValue.MediaProductType Threads) + | "THREADS" -> + values.Add(ReplyFieldValue.MediaProductType MediaProductType.Threads) | other -> () // new value added? ) |> Option.defaultValue()