Skip to content

Add POST endpoint to Notification Controller - #635

Open
AshishJii wants to merge 3 commits into
WordPress:developfrom
AshishJii:feat/notif-post
Open

AshishJii wants to merge 3 commits into
WordPress:developfrom
AshishJii:feat/notif-post

Conversation

@AshishJii

@AshishJii AshishJii commented Oct 20, 2026 •

Copy link
Copy Markdown

(to be checked after #611)

What

Adds POST /wp-notifications/v1/notifications so authenticated users can queue a notification by message ID.

Why

The controller had GET and PUT but no way to create notifications via the API.

How

A CREATABLE route accepts a required id param (message ID). The controller builds a Notification using the factory with the given message ID and get_current_user_id(), then calls repository->add().

Testing

npx wp-env run tests-cli -- /var/www/html/wp-content/plugins/wp-feature-notifications/vendor/bin/phpunit --configuration=/var/www/html/wp-content/plugins/wp-feature-notifications/phpunit.xml.dist

Closes #375

This branch has not been deployed

No deployments
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.

MVP Notification Controller: POST /notifications/

1 participant