Closed tomsouthall-zz closed 9 years ago
I don't think this is an MVP bug.
Problem is that links for anything that gets deleted are currently broken and cause errors, so we either need to add the flag or not display the links at all. Or I could catch the error and display some sort of message - but that's a lot more work than what I proposed so would rather not.
Right now if the user delete something it's gone, removed from the database. We can come back around and change that behavior later, but for MVP, I think the corresponding offer/promo should be just removed from the UI if the user deletes it. Gone is gone, currently.
OK that works. A change is needed then on both end-points to filter out deleted promos and rcos.
I can take this one but are we sure we wouldn't rather undo the delete function and make it more of a disable in the DB?
@bpromo Where do we stand on this issue?
Oooh this fell off my radar. Haven't looked at it at all. Thanks for reminding me.
So to implement as it stands I need to check the list produced for metrics/rco
and metrics/promos
against the database to see if they exists anymore and then set the deleted
flag appropriately.
Should be able to wrap this up tomorrow. If the above is incorrect please let me know.
We are going to want to remove the hard delete feature. Could make analytics and machine learning a lot more tricky if records disappear underneath us over time.
When I list the promos and offers on the metrics page, I provide a link allowing the user to quickly access the corresponding edit screen (see screenshot).
However, if the promo or offer happens to be deleted, I should not be creating the link. However I currently do as I have no way to know if the promo/offer is deleted, and following it results in a 500 error.
I need a
deleted
flag to be added to any entity in the response that has been deleted.e.g.
If the entity is not deleted, the flag can either be set to
false
or simply not be present. Either is fine.