icebreaker-science / backend

The backend (Spring Boot) part of the icebreaker.science application
Apache License 2.0
2 stars 0 forks source link

List own entries #18

Closed chaoran-chen closed 4 years ago

chaoran-chen commented 4 years ago

This endpoint should return a list of device-availability entries that the currently logged-in user has created. I am not sure what the address of the endpoint should be. Maybe /device-availability?mine=true?

Request:

GET /???

Response:

Status code 200:

[
  {
    id: int
    deviceId: int,
    comment: string (optional),
    germanPostalCode: string (optional),
    institution: string,
    researchGroup: string (optional)
  }
]
michael-kamel commented 4 years ago

We could do /account/me/device_availability_list. Imo, The one you suggested is fine too as long as we stick to a standard for similar endpoints. One would be easier to develop and possibly maintain but yields an additional controller, while the other is the opposite.

dajenet commented 4 years ago

We could use /device-availability?account-id={own-id}. That would probably be more flexible if we want to display the devices of other users as well in the future.