create: privateProcedure
.mutation(async ({ ctx, input }) => {
const inserted = await ctx.db.insert(posts).values({
content: input.content,
authorId: ctx.currentUser,
});
return ctx.db
.select()
.from(posts)
.where(eq(posts.id, Number(inserted.insertId)));
}),
create: privateProcedure
.mutation(async ({ ctx, input }) => {
const inserted = await ctx.db.insert(posts).values({
content: input.content,
authorId: ctx.currentUser,
});
return ctx.db
.select()
.from(posts)
.where(eq(posts.id, Number(inserted.insertId)));
}),