title: How to get only currentUser related content in NestJs with prisma
body: <p>Im creating a multi company app which logged user will only have access to his content. At the moment i don't want to implement multi tentant in this app.</p>
  <p>I have created a Decorator to get the current logged user:</p>
  <pre><code>import { createParamDecorator, ExecutionContext } from '@nestjs/common';
  
  export const CurrentUser = createParamDecorator(
    (data: unknown, ctx: ExecutionContext) =&gt; {
      const request = ctx.switchToHttp().getRequest();
      return request.user;
    },
  );
  </code></pre>
  <p>And used this decorator on my controller actions to get the companyId of the user and pass this ID to the service.</p>
  <pre><code> @Get()
    async getAll(
      @CurrentUser()
      currentUser,
    ) {
      return this.categoryService.getAll(currentUser.companyId);
    }
  </code></pre>
  <p>Now, on service i have access to the companyId and can access his content:</p>
  <pre><code>  async getAll(companyId: string) {
      const categories = await this.prisma.category.findMany({
        where: { companyId: companyId },
      });
  
      return categories;
    }
  </code></pre>
  <p>The BIG problem is that i will have to repeat this process in every controller, services and etc.</p>
  <p>Is there any easier way to do this? Anything i can use on the service level? How can i solve this?</p>