Added 'path' to user stories, works now.

yay
This commit is contained in:
David Kelly 2016-08-09 14:15:49 -07:00
parent 8457acd234
commit 18990821df

View file

@ -189,16 +189,19 @@ void SnapshotUploader::uploadSuccess(QNetworkReply& reply) {
auto doc = QJsonDocument::fromJson(contents, &jsonError); auto doc = QJsonDocument::fromJson(contents, &jsonError);
if (jsonError.error == QJsonParseError::NoError) { if (jsonError.error == QJsonParseError::NoError) {
QString thumbnailUrl = doc.object().value("thumbnail_url").toString(); QString thumbnailUrl = doc.object().value("thumbnail_url").toString();
QString placeName = DependencyManager::get<AddressManager>()->getPlaceName(); auto addressManager = DependencyManager::get<AddressManager>();
QString placeName = addressManager->getPlaceName();
if(placeName.isEmpty()) { if(placeName.isEmpty()) {
placeName = DependencyManager::get<AddressManager>()->getHost(); placeName = addressManager->getHost();
} }
QString currentPath = addressManager->currentPath(true);
// create json post data // create json post data
QJsonObject rootObject; QJsonObject rootObject;
QJsonObject userStoryObject; QJsonObject userStoryObject;
userStoryObject.insert("thumbnail_url", thumbnailUrl); userStoryObject.insert("thumbnail_url", thumbnailUrl);
userStoryObject.insert("place_name", placeName); userStoryObject.insert("place_name", placeName);
userStoryObject.insert("path", currentPath);
userStoryObject.insert("action", "snapshot"); userStoryObject.insert("action", "snapshot");
rootObject.insert("user_story", userStoryObject); rootObject.insert("user_story", userStoryObject);