Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
EdSDR committed Jul 10, 2024
1 parent e5b7cb8 commit 4ac417a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
18 changes: 13 additions & 5 deletions packages/api/src/router/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,24 @@ export const moduleRouter = {
});
return userWeightMap;
}),

// POST
createUserModuleData: publicProcedure
.input(userModuleDataPostSchema)
.mutation(({ ctx, input }) => {
return ctx.db.insert(userModuleData).values(input);
.mutation(async ({ ctx, input }) => {
await ctx.db.insert(userModuleData).values({
moduleKey: input.moduleKey,
userKey: input.userKey,
weight: input.weight,
});
}),
createModuleReport: publicProcedure
.input(moduleReportPostSchema)
.mutation(({ ctx, input }) => {
return ctx.db.insert(moduleReport).values(input);
.mutation(async ({ ctx, input }) => {
await ctx.db.insert(moduleReport).values({
moduleKey: input.moduleKey,
userKey: input.userKey,
content: input.content,
reason: input.reason,
});
}),
} satisfies TRPCRouterRecord;
1 change: 0 additions & 1 deletion packages/db/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,4 @@ export const moduleReportPostSchema = createInsertSchema(moduleReport, {
reason: z.string(),
}).omit({
id: true,
createdAt: true,
});
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@
"react": "^18.3.1"
},
"prettier": "@commune-ts/prettier-config"
}
}

0 comments on commit 4ac417a

Please sign in to comment.