enable update account name from account page

This commit is contained in:
Michael Dausmann
2023-04-02 17:28:52 +10:00
parent 45d671f432
commit 8fc900fbf1
5 changed files with 32 additions and 2 deletions

View File

@@ -10,6 +10,16 @@ export const userAccountRouter = router({
dbUser: ctx.dbUser,
}
}),
changeAccountName: adminProcedure
.input(z.object({ account_id: z.number(), new_name: z.string() }))
.query(async ({ ctx, input }) => {
const uaService = new UserAccountService();
const account = await uaService.changeAccountName(input.account_id, input.new_name);
return {
account,
}
}),
changeAccountPlan: adminProcedure
.input(z.object({ account_id: z.number(), plan_id: z.number() }))
.query(async ({ ctx, input }) => {