module LoggedIn.Category.Update exposing
  ( update
  )

import Form exposing (Form)

import LoggedData exposing (LoggedData)

import LoggedIn.Category.Model as Category
import LoggedIn.Category.Msg as Category

update : LoggedData -> Category.Msg -> Category.Model -> (Category.Model, Cmd Category.Msg)
update loggedData msg model =
  case msg of

    Category.NoOp ->
      ( model
      , Cmd.none
      )

    Category.AddCategoryMsg formMsg ->
      ( { model | addCategory = Form.update Category.validation formMsg model.addCategory }
      , Cmd.none
      )