When a message is for multiple users:
curl -u dev:dev -X 'POST' \ 'http://localhost:8080/api/v1/messages' \ -H 'accept: */*' \ -H 'Content-Type: application/json' \ -d '{ "usernames": [ "dev", "myname", "mysecondname" ], "groupnames": [ "mygroup" ], "subject": "My subject", "messageType": "My type", "body": "My body" }'
When try to retrieve, the JPA repo query is failing, my guess is that user is not filter in the query here:
to test it create the record, and after that, execute the GET request:
curl -u dev:dev -X 'GET' \ 'http://localhost:8080/api/v1/notifications' \ -H 'accept: */*'
If I create only one user for message, things works ok:
$ --> curl -u dev:dev -X 'POST' \ 'http://localhost:8080/api/v1/messages' \ -H 'accept: */*' \ -H 'Content-Type: application/json' \ -d '{ "usernames": [ "dev" ], "groupnames": [ "mygroup" ], "subject": "My subject2", "messageType": "My type", "body": "My body" }' $ --> curl -u dev:dev -X 'GET' \ 'http://localhost:8080/api/v1/notifications' \ -H 'accept: */*' { "_embedded" : { "notificationrecords" : [ { "id" : "5a5cf729-0206-46fa-813e-c9f47184ac99", "subject" : "My subject", "createdOn" : "2023-03-29T10:00:22.503029Z", "messageType" : "My type", "body" : "My body", "fromuser" : "dev", "read" : false, "tags" : [ ] }, { "id" : "3197a8f8-9139-4a4f-85f7-23912599517a", "subject" : "My subject2", "createdOn" : "2023-03-29T10:01:50.787607Z", "messageType" : "My type", "body" : "My body", "fromuser" : "dev", "read" : false, "tags" : [ ] } ] }, "_links" : { "self" : { "href" : "http://localhost:8080/api/v1/notifications?page=0&size=100" } }, "page" : { "size" : 100, "totalElements" : 2, "totalPages" : 1, "number" : 0 } }% $ -->
- is related to
-
FLPATH-234 Populate Notification tab with data
- Closed