Skip to content

Commit

Permalink
refactor: fix compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelMunoz committed Nov 3, 2024
1 parent 2cd4475 commit 4369d73
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions Threads.Lib.Tests/Posts.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ open Flurl.Util
open Microsoft.VisualStudio.TestTools.UnitTesting
open Flurl.Http.Testing

open Threads.Lib
open Threads.Lib.Posts


Expand Down
7 changes: 3 additions & 4 deletions Threads.Lib.Tests/ReplyManagement.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ open Flurl.Http
open Flurl.Http.Testing

open Threads.Lib

open Threads.Lib.ReplyManagement


Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion Threads.Lib/Media.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> ()

Expand Down
2 changes: 1 addition & 1 deletion Threads.Lib/Pagination.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module internal IdLike =

val Decode: Decoder<IdLike>

[<Struct>]
[<Struct; RequireQualifiedAccess>]
type MediaProductType = | Threads

module internal MediaProductType =
Expand Down
6 changes: 4 additions & 2 deletions Threads.Lib/ReplyManagement.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit 4369d73

Please sign in to comment.