Skip to content

Conversation

@alfetopito
Copy link
Contributor

Summary

Add a way to manually trigger the notification clean up.
The cronjob has been added for a few days, but the notifications had not been cleaned up.

Since the strapi cloud logs are quite bad to navigate, this should give instant feedback on what's wrong.

Testing

  1. Create a new API token with the permission Notification > cleanup > cleanupExpiredNotifications:
    image
  2. Make POST request containing the header: authorization: bearer <api key>
  • The request should succeed and return the response.

Example of a successful response:

{
    "data": {
        "success": true,
        "deletedCount": 0
    }
}

Example of an error response:

{
    "data": {
        "success": false,
        "error": "This is a test error"
    }
}

@alfetopito alfetopito requested a review from a team March 13, 2025 18:38
@alfetopito alfetopito self-assigned this Mar 13, 2025
@alfetopito alfetopito merged commit 1ce78a8 into main Mar 13, 2025
3 checks passed
@alfetopito alfetopito deleted the feat/manually-trigger-notification branch March 13, 2025 18:40
Copy link
Contributor

@anxolin anxolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants