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("pkgVersionType", "LATEST")
|
||||||
.AddValue("userNickname", fUsername)
|
.AddValue("userNickname", fUsername)
|
||||||
.AddValue("rating", rating)
|
.AddValue("rating", rating)
|
||||||
.AddValue("userRatingStabilityCode", stability)
|
.AddValue("userRatingStabilityCode", stability, true)
|
||||||
.AddValue("comment", comment)
|
.AddValue("comment", comment)
|
||||||
.AddValue("naturalLanguageCode", languageCode)
|
.AddValue("naturalLanguageCode", languageCode)
|
||||||
.EndObject()
|
.EndObject()
|
||||||
@@ -496,7 +496,7 @@ WebAppInterface::UpdateUserRating(const BString& ratingID,
|
|||||||
.AddObject()
|
.AddObject()
|
||||||
.AddValue("code", ratingID)
|
.AddValue("code", ratingID)
|
||||||
.AddValue("rating", rating)
|
.AddValue("rating", rating)
|
||||||
.AddValue("userRatingStabilityCode", stability)
|
.AddValue("userRatingStabilityCode", stability, true)
|
||||||
.AddValue("comment", comment)
|
.AddValue("comment", comment)
|
||||||
.AddValue("naturalLanguageCode", languageCode)
|
.AddValue("naturalLanguageCode", languageCode)
|
||||||
.AddValue("active", active)
|
.AddValue("active", active)
|
||||||
|
|||||||
@@ -427,7 +427,7 @@ RatePackageWindow::_QueryRatingThread()
|
|||||||
}
|
}
|
||||||
if (result.FindString("userRatingStabilityCode",
|
if (result.FindString("userRatingStabilityCode",
|
||||||
&fStability) == B_OK) {
|
&fStability) == B_OK) {
|
||||||
int32 index = -1;
|
int32 index = 0;
|
||||||
for (int32 i = fStabilityCodes.CountItems() - 1; i >= 0; i--) {
|
for (int32 i = fStabilityCodes.CountItems() - 1; i >= 0; i--) {
|
||||||
const StabilityRating& stability
|
const StabilityRating& stability
|
||||||
= fStabilityCodes.ItemAtFast(i);
|
= fStabilityCodes.ItemAtFast(i);
|
||||||
@@ -493,6 +493,9 @@ RatePackageWindow::_SendRatingThread()
|
|||||||
|
|
||||||
Unlock();
|
Unlock();
|
||||||
|
|
||||||
|
if (stability == "unspecified")
|
||||||
|
stability = "";
|
||||||
|
|
||||||
status_t status;
|
status_t status;
|
||||||
BMessage info;
|
BMessage info;
|
||||||
if (ratingID.Length() > 0) {
|
if (ratingID.Length() > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user