Estoy tratando de hacer una lista de observación creada por cada usuario que debe iniciar sesión en mi aplicación.
En mi serve.js tengo esto:
const rules = auth.rewriter({ users: 600, watchedMovies: 644, watchlist: 644, });Pero tengo que hacer esto para atribuir estos datos a mi usuario en db.json:
{ "users": [ { "email": "bartosz@mail.com", "password": "********", "id": 2, "watchedMovies": [ { "type": "Thriller", "title": "The Silence of Lambs", "id": 2 }, { "type": "Drama", "title": "The godfather", "id": 3 }, { "type": "Drama", "title": "The lives of others", "id": 4 } ], "watchlist": [] } ] }Sin embargo, solo tengo esto:
{ "users": [ { "email": "bartosz@mail.com", "password": "*******", "id": 2 } ], "watchedMovies": [ { "type": "Thriller", "title": "The Silence of Lambs", "id": 2 }, { "type": "Drama", "title": "The godfather", "id": 3 }, { "type": "Drama", "title": "The lives of others", "id": 4 } ], "watchlist": [] }¿Cómo puedo hacer algo como http://localhost:3000/users/watchlist?