Add put and delete for variants#37
Conversation
| for _, s := range f.Segments { | ||
| for _, d := range s.Distributions { | ||
| if d.VariantID == util.SafeUint(params.VariantID) && d.Percent != uint(0) { | ||
| return NewError(400, "error deleting variant %v. distribution %v still has non-zero distribution %v", params.VariantID, d.ID, d.Percent) |
There was a problem hiding this comment.
Note, we cannot delete a variant if it's rolling out to some non-zero distribution
There was a problem hiding this comment.
oo ok, yea, i can put that check on the frontend too
There was a problem hiding this comment.
actually, i don't think you can delete a variant at all if some distribution is using it
There was a problem hiding this comment.
yup, actually I need to remove all the distribution that has the references to it
There was a problem hiding this comment.
ohh, so do you want it so when they delete a variant, it deletes all referenced distributions? or just not allow that until they delete the distribution?
There was a problem hiding this comment.
going to delete the referenced distribution if percent is 0, otherwise, return 400
2bb42b2 to
2914bd0
Compare
2914bd0 to
e349d4e
Compare
Put and delete for variants