Closed rbcorrales closed 2 years ago
Logic looks sound, but it would be good to try and get an integration test added for this deletion, to show that it is working correctly.
The test is relatively simple - create a generic post
post, and an ad-code
ad, and then try to delete both of them - one will succeed with this patch in place, and will fail (returns null
from the delete method).
Before (with the fix not applied):
After (with the fix applied):
Validate that the post type of the received post ID matches
acm-code
before attempting a deletion to prevent deleting other types of posts.This function gets called when deleting a single ad code or doing a bulk deletion.