Commit a7053d92 authored by Emmanuel Raviart's avatar Emmanuel Raviart

Add rating parameter when upserting a property (for compatibility with Retruco-API).

parent 4eceae0c
......@@ -382,7 +382,7 @@ update msg model =
Debug.crash "Cards.Item.State update ValueUpserted: model.editedKeyId == Nothing"
in
( { model | data = mergeData data model.data }
, Requests.postProperty model.authentication model.cardId editedKeyId data.id
, Requests.postProperty model.authentication model.cardId editedKeyId data.id 1
|> Http.send (ForSelf << PropertyUpserted)
)
......
......@@ -111,7 +111,7 @@ update msg model =
ValueUpserted data ->
( { model | data = mergeData data model.data }
, Requests.postProperty model.authentication model.objectId model.keyId data.id
, Requests.postProperty model.authentication model.objectId model.keyId data.id 1
|> Http.send (ForSelf << Upserted)
)
......
......@@ -349,8 +349,8 @@ postCollection authentication collectionId collectionJson =
}
postProperty : Maybe Authentication -> String -> String -> String -> Http.Request DataIdBody
postProperty authentication objectId keyId valueId =
postProperty : Maybe Authentication -> String -> String -> String -> Int -> Http.Request DataIdBody
postProperty authentication objectId keyId valueId rating =
Http.request
{ method = "POST"
, headers = authenticationHeaders authentication
......@@ -359,6 +359,7 @@ postProperty authentication objectId keyId valueId =
Encode.object
[ ( "keyId", Encode.string keyId )
, ( "objectId", Encode.string objectId )
, ( "rating", Encode.int rating )
, ( "valueId", Encode.string valueId )
]
|> Http.jsonBody
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment