Last active
August 29, 2015 13:59
-
-
Save bespalown/10713438 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
В таком формате получаю все списки по GET запросу: | |
http://api.checena.ru:80/v1/shopping_lists.json?detailed=1 | |
{ | |
"id": "534ce9ea61646d7c8d020000", | |
"updated_at": 1397549546, | |
"title": "23", | |
"items_count": 1, | |
"total_price": { | |
"cents": 0, | |
"currency": "RUB" | |
}, | |
"items": [ | |
{ | |
"id": "534cea0861646d7dbd000000", | |
"title": "Тачка садовая FIT, 65 л", | |
"count": 1, | |
"products_list_id": "534ce9ea61646d7c8d020000", | |
"stricken": false, | |
"updated_at": 1397549576, | |
"product": { | |
"id": 1202329, | |
"name": "Тачка садовая FIT, 65 л", | |
"rating": null, | |
"image_url": "http://fair-price.biz/images/tovar/main/56efac9cf149b505ba2c32adc1133776.jpeg", | |
"thumb_image_url": "http://fair-price.biz/images/tovar/small/56efac9cf149b505ba2c32adc1133776.jpeg", | |
"amount": null, | |
"units": null, | |
"price": null | |
} | |
} | |
] | |
} | |
Вот что получаю после добавления товара: | |
PUT /v1/shopping_lists_sync.json | |
( | |
{ | |
id = 534ce9ea61646d7c8d020000; | |
items = ( | |
{ | |
count = 1; | |
id = 534cea0861646d7dbd000000; | |
"product_id" = 1202329; | |
"products_list_id" = 534ce9ea61646d7c8d020000; | |
stricken = 0; | |
title = "\U0422\U0430\U0447\U043a\U0430 \U0441\U0430\U0434\U043e\U0432\U0430\U044f FIT, 65 \U043b"; | |
"updated_at" = 1397549576; | |
} | |
); | |
"items_count" = 1; | |
title = 23; | |
"total_price" = { | |
cents = 0; | |
currency = RUB; | |
}; | |
"updated_at" = 1397549546; | |
} | |
) | |
______________________ | |
Вот почему у меня product_id занулялся, не от туда брался. Было бы круто добавить модель product в items. Тем самым будем иметь всегда актуальные картинки, цены, рейтинг и тп. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment