gcivil-nyu-org / team-5-inperson

3 stars 4 forks source link

Bookmark be suyash #179

Closed TheHarbinger99 closed 1 year ago

TheHarbinger99 commented 1 year ago

completed backend for bookmark functionality

api ->

"api/bookmark/str:pk1/str:pk2/int:pk3/int:pk4/"

(username, amenity_type, amenity_id, is_bookmarked)

to bookmark true->

api call example -> http://127.0.0.1:8000/NycBasics/api/bookmark/hi1/wifi/34/1/

(username = hi1, amenity_type = wifi, amenity_id = 34, is_bookmarked =1) result-> { "id": 1, "amenity_type": "wifi", "amenity_id": 34, "is_bookmarked": true, "user": 105 } (user 105 signifies user id for username hi1)

to bookmark false->

http://127.0.0.1:8000/NycBasics/api/bookmark/hi1/wifi/34/0/

result-> { "id": 1, "amenity_type": "wifi", "amenity_id": 34, "is_bookmarked": false, "user": 105 }