Help getting started with expanding the Users

System Information
  • Strapi Version: 3.5.4
  • Operating System: Windows 10
  • Database: SQLite (No change since initial startup)
  • Node Version: 14.15.1
  • NPM Version: 6.14.8
  • Yarn Version: 1.22.5

Hey everyone, this is only my first question here, I got up and going very quickly which was great, but now I am hoping to expand on the users that are registered and logged in. I would like to allow them to “favourite” an article/other content types that I’ve built up. This is basically the last thing I’d like to finish before putting this in production so any pointers on resources would be great, is Bookshelf.js where I should be looking?

Thanks for your time,

Hi @conorjohn, Welcome to the Community! Have you considered creating a relation in the User content type i.e favourite_articles that relates to the articles in question? That should be a great start I think!

1 Like

Hey Richard! Cheers, I’ve genuinely enjoyed using Strapi so far too :slight_smile:
I have gotten that going since I asked the question alright, and I get that linked Content Type back in the response when I log in as a user too

I have also been referring to the answer you gave me on retrieving auth’d user data which has helped me get to a certain point where I have something working but 2 requests are needed. I am getting the users/me response, but that doesn’t have the linked content type in the response. What I can do is get my ID from users/me, and then run a query on UsersPermissionsUser to get a user by that ID and then I get the user type with my linked content types. I’m using the GraphQL plugin (the schemas to the side were very helpful too)

I was wondering if there’s any way for me to bridge this gap at the moment? Right now I dont really want to leave this as is because it opens up the search users by ID which isn’t ideal to me. I understand this may be very specific so no hassle if not, I’ve already made huge progress thanks to your answers so thank you again :slight_smile:

There definitely is! Take a look at this answer I posted on a Github Issue. That should help :slight_smile:

1 Like

You’re a gentleman, thanks so much!

1 Like