IamIconLivingI
tRPC2y ago
6 replies
IamIconLiving

I have an actual data returned, but I get 404 spammed in the console

It's a bit weird, I have the data returned but I also get 404 at the same time.
Here is usage on the frontend:
  const { data, error } = api.profile.get.useQuery();
  console.log("profile get error", error);
  console.log("profile data", data);

And here is the route:
export const profileRouter = createTRPCRouter({
  get: privateProcedure.query(({ ctx }) => {
    const profile = ctx.db.profiles.findFirst({
      where: {
        id: ctx.user.id,
      },
    });
    return profile;
  }),

What can I do to fix it?
image.png
Was this page helpful?