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

Commit e6efabd

Browse files
authored
Merge pull request #2021 from OpenBazaar/modfee
(#1949) Fix patching profile with moderator fee
2 parents bf685d8 + 38d84ca commit e6efabd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

core/profile.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,13 @@ func (n *OpenBazaarNode) PatchProfile(patch map[string]interface{}) error {
195195

196196
repoProfile.NormalizeDataForAllSchemas()
197197

198+
if repoProfile.GetProtobuf().ModeratorInfo != nil &&
199+
repoProfile.GetProtobuf().ModeratorInfo.Fee != nil &&
200+
repoProfile.GetProtobuf().ModeratorInfo.Fee.FeeType == pb.Moderator_Fee_PERCENTAGE {
201+
202+
repoProfile.GetProtobuf().ModeratorInfo.Fee.FixedFee = nil
203+
}
204+
198205
if err := repoProfile.Valid(); err != nil {
199206
return fmt.Errorf("invalid profile: %s", err.Error())
200207
}

0 commit comments

Comments
 (0)