Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1287 from OpenBazaar/fixStatsToZero
Browse files Browse the repository at this point in the history
Delete entire stats object when saving.
  • Loading branch information
rmisio authored Mar 23, 2018
2 parents 3a27407 + 7e550c9 commit 20eb435
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions js/models/profile/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,7 @@ export default class Profile extends BaseModel {
if (method !== 'read') {
delete options.attrs.lastModified;

if (options.attrs.stats) {
delete options.attrs.stats.followerCount;
delete options.attrs.stats.followingCount;
delete options.attrs.stats.listingCount;
delete options.attrs.stats.ratingCount;
delete options.attrs.stats.averageRating;
}
if (options.attrs.stats) delete options.attrs.stats;

const images = [options.attrs.avatarHashes, options.attrs.headerHashes];
images.forEach(imageHashes => {
Expand Down

0 comments on commit 20eb435

Please sign in to comment.