Title:
POST /api/v1/settings/marketing/campaigns/mass-destroy returns misleading success message for non-existent IDs
Description:
When attempting to delete campaign IDs that no longer exist (i.e., already deleted), the API still returns a 200 OK response with the message:
"Marketing campaigns deleted successfully."
This is misleading, as no actual deletion occurs when the provided IDs are not valid or present in the database.
Affected Endpoint:
POST /api/v1/settings/marketing/campaigns/mass-destroy
Preconditions:
- Campaign with ID
1 was deleted earlier and does not exist in the system.
Steps to Reproduce:
- Send a request to delete a non-existent campaign:
curl -X 'POST' \
'http://<host>/api/v1/settings/marketing/campaigns/mass-destroy' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
"indices": [1]
}'
- Observe the API response.
Actual Result:
{
"data": {
"message": "Marketing campaigns deleted successfully."
}
}
Expected Result:
A response indicating that no campaigns were deleted, such as:
{
"data": {
"message": "No campaigns found for deletion."
}
}
Title:
POST /api/v1/settings/marketing/campaigns/mass-destroyreturns misleading success message for non-existent IDsDescription:
When attempting to delete campaign IDs that no longer exist (i.e., already deleted), the API still returns a 200 OK response with the message:
"Marketing campaigns deleted successfully."This is misleading, as no actual deletion occurs when the provided IDs are not valid or present in the database.
Affected Endpoint:
POST /api/v1/settings/marketing/campaigns/mass-destroyPreconditions:
1was deleted earlier and does not exist in the system.Steps to Reproduce:
Actual Result:
{ "data": { "message": "Marketing campaigns deleted successfully." } }Expected Result:
A response indicating that no campaigns were deleted, such as:
{ "data": { "message": "No campaigns found for deletion." } }