I cant create a relation between a post and a user

  • Strapi Version:4.3.4
  • Operating System: WIndows
  • Database: sqlite
  • Node Version: 16.17.0
  • NPM Version: 8.14.0
  • Yarn Version:

I can create a relation between sub post and a post but not between a post and a user. my code.Is there a trick to this.

 console.log(title, description, category, language, auth.user.email);
      const response = await axios.post(
        `${process.env.NEXT_PUBLIC_SERVER_URL}/api/posts`,
        {
          data: {
            title,
            description,
            category,
            language,
            users_permissions_user: auth.user.id,
          },
        },
        {
          headers: {
            Authorization: `Bearer ${auth.jwt}`,
          },
        },
      );
1 Like

same issue here! i’all try with graphql and rest Api but same problem

Strapi because useless in many usecases this way. For now i will be using something else to build my backend.

I finally found the problem, strapi protect some field from return and there’s no way to unlock unlees made some patch. One of the protected field is all concern user_permission on return from controller api

Have you updated the role permissions? You will need findOne user allowed