TUM-Dev / gocast

TUMs lecture streaming service.
https://live.rbg.tum.de/
MIT License
177 stars 41 forks source link

Target not correct for user notifications #1298

Open carlobortolan opened 5 months ago

carlobortolan commented 5 months ago

Describe the bug When creating a "user notification" via the tumlive web-app, you should be able to define who the notification should be sent to (e.g., admin: target=5, lecturers: target=4, students target=3, loggedIn target=2, allUsers target=1). However, when doing so, internally it currently always sets the target to 1 targeting always all users.

To Reproduce Steps to reproduce the behavior:

  1. Go to the admin dashboard (localhost:8081/admin)
  2. Click on user notifications (localhost:8081/admin/notifications)
  3. Create a new user notification targeting "Loggedin users", "Students", "Lecturers" or "Admins" and when checking the records in the db, the target is always set to 1
  4. (See screenshots below)

Expected behavior When creating a "user notification" via the tumlive web-app, you should be able to define who the notification should be sent to (e.g., admin: target=5, lecturers: target=4, students target=3, loggedIn target=2, allUsers target=1).

Screenshots Create notification for "Admins" -> Target set to 1 instead of 5 Create notification for "Lecturers" -> Target set to 1 instead of 4. Create notification for "Students" -> Target set to 1 instead of 3. Create notification for "Loggedin users" -> Target set to 1 instead of 2.

image image image image image

Desktop:

Additional context