Skip to content

GET /notificaitons #1154

Open
devnchill wants to merge 6 commits into
NixOS:mainfrom
devnchill:feat/get-notifications
Open

GET /notificaitons #1154
devnchill wants to merge 6 commits into
NixOS:mainfrom
devnchill:feat/get-notifications

Conversation

@devnchill

Copy link
Copy Markdown
Member

Related to #1024 (#1024 (comment))

notifications/ seems like a pretty standalone thing to tackle @devnchill, and I can implement the front side of things after. API only

  • Adds REST API endpoint for GET notifications
  • Tests for GET notifications

@devnchill devnchill marked this pull request as draft June 28, 2026 15:19
@devnchill devnchill marked this pull request as ready for review June 28, 2026 16:25
@devnchill devnchill force-pushed the feat/get-notifications branch from 4eae1a2 to 451eb34 Compare June 28, 2026 16:54
Comment thread src/api/notifications/views.py
@DarshanCode2005

Copy link
Copy Markdown
Collaborator

tests are nice ❤️

suggestion: you should implement tests for GET /notifications/:id example:
1> retrieve own notification - 200
2> retrieve another user's notification - 404
3> retrieve non-existent id - 404

@DarshanCode2005

Copy link
Copy Markdown
Collaborator

for notification frontend will most likely require message for TextNotification you could confirm it with @florentc sir.

@DarshanCode2005

Copy link
Copy Markdown
Collaborator

@devnchill you could add @extend_schema for OPENAPI.

Also, test_token_auth.py probes auth on other endpoints, but notifications have no equivalent , a small test would document that API-key clients can use this endpoint.

@devnchill

devnchill commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

tests are nice ❤️

suggestion: you should implement tests for GET /notifications/:id example: 1> retrieve own notification - 200 2> retrieve another user's notification - 404 3> retrieve non-existent id - 404

thanks 😄 , yeah I was aware about missing test for that but thought it would it would be best practice to write tests for /notifications/:id in separate pr , this was meant just for GET /notification ... and /notification:id is kind of sideeffect of ReadOnly viewset 😅 ... @florentc @fricklerhandwerk any thoughts ....

@devnchill devnchill force-pushed the feat/get-notifications branch from 430aa4e to 74b6806 Compare July 7, 2026 08:42
@devnchill

Copy link
Copy Markdown
Member Author

resolved merge conflicts and rebased 😅

@devnchill devnchill force-pushed the feat/get-notifications branch from 74b6806 to b9a76fc Compare July 7, 2026 08:53
@devnchill devnchill force-pushed the feat/get-notifications branch from b9a76fc to dbe75c6 Compare July 7, 2026 08:56
Signed-off-by: Viena <169875752+devnchill@users.noreply.github.com>
@florentc

florentc commented Jul 7, 2026

Copy link
Copy Markdown
Member

Thanks for the PR and review. We'll indeed want the text content in the serialized text notifications. As for the suggestion notifications, we'll want the suggestion id so that the frontend or the user can query this suggestion later. I'm currently working on the suggestions API including the suggestion serializer so for now in this PR let's only return the suggestion_id. If needed in the future we can inline the suggestion in the response.

@devnchill devnchill force-pushed the feat/get-notifications branch from 86a0917 to d096d0b Compare July 8, 2026 07:25
Signed-off-by: Viena <169875752+devnchill@users.noreply.github.com>
@devnchill devnchill force-pushed the feat/get-notifications branch from d096d0b to 44f9370 Compare July 8, 2026 07:38
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