Skip to content

Commit

Permalink
make naming of "Api" consistent in wishlist
Browse files Browse the repository at this point in the history
  • Loading branch information
Larocceau committed Mar 8, 2024
1 parent 308f216 commit adee31f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Client/pages/WishList.fs
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ let init api (user: UserData) =

model, cmd

let update booksApi msg model =
let update api msg model =
match msg with
| GotLastRestTime time -> { model with LastResetTime = time }, Cmd.none
| GotWishlist wishlist -> { model with Wishlist = wishlist }, Cmd.none
| RemoveBook title ->
let userName = model.Wishlist.UserName

let cmd =
Cmd.OfAsync.either booksApi.removeBook (userName, title) RemovedBook UnhandledError
Cmd.OfAsync.either api.removeBook (userName, title) RemovedBook UnhandledError

model, cmd
| RemovedBook title ->
Expand All @@ -81,7 +81,7 @@ let update booksApi msg model =
match model.Wishlist.VerifyNewBookIsNotADuplicate book with
| Ok _ ->
let userName = model.Wishlist.UserName
model, Cmd.OfAsync.either booksApi.addBook (userName, book) AddedBook UnhandledError
model, Cmd.OfAsync.either api.addBook (userName, book) AddedBook UnhandledError
| Error error -> model, Exception(error) |> UnhandledError |> Cmd.ofMsg
| NewBook.Cancel, _ -> { model with NewBook = None }, Cmd.none
| _, Some newBook ->
Expand Down

0 comments on commit adee31f

Please sign in to comment.