HaikuDepot: Don't try to send "unspecified" stability
Set to empty string and cause the JSON to have null. Fixes sending/editing comments without specifying a stability rating.
This commit is contained in:
@@ -471,7 +471,7 @@ WebAppInterface::CreateUserRating(const BString& packageName,
|
||||
.AddValue("pkgVersionType", "LATEST")
|
||||
.AddValue("userNickname", fUsername)
|
||||
.AddValue("rating", rating)
|
||||
.AddValue("userRatingStabilityCode", stability)
|
||||
.AddValue("userRatingStabilityCode", stability, true)
|
||||
.AddValue("comment", comment)
|
||||
.AddValue("naturalLanguageCode", languageCode)
|
||||
.EndObject()
|
||||
@@ -496,7 +496,7 @@ WebAppInterface::UpdateUserRating(const BString& ratingID,
|
||||
.AddObject()
|
||||
.AddValue("code", ratingID)
|
||||
.AddValue("rating", rating)
|
||||
.AddValue("userRatingStabilityCode", stability)
|
||||
.AddValue("userRatingStabilityCode", stability, true)
|
||||
.AddValue("comment", comment)
|
||||
.AddValue("naturalLanguageCode", languageCode)
|
||||
.AddValue("active", active)
|
||||
|
||||
@@ -427,7 +427,7 @@ RatePackageWindow::_QueryRatingThread()
|
||||
}
|
||||
if (result.FindString("userRatingStabilityCode",
|
||||
&fStability) == B_OK) {
|
||||
int32 index = -1;
|
||||
int32 index = 0;
|
||||
for (int32 i = fStabilityCodes.CountItems() - 1; i >= 0; i--) {
|
||||
const StabilityRating& stability
|
||||
= fStabilityCodes.ItemAtFast(i);
|
||||
@@ -493,6 +493,9 @@ RatePackageWindow::_SendRatingThread()
|
||||
|
||||
Unlock();
|
||||
|
||||
if (stability == "unspecified")
|
||||
stability = "";
|
||||
|
||||
status_t status;
|
||||
BMessage info;
|
||||
if (ratingID.Length() > 0) {
|
||||
|
||||
Reference in New Issue
Block a user