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

@@ -151,6 +151,15 @@ export default class UserAccountService {
});
}
async changeAccountName(account_id: number, new_name: string) {
return prisma_client.account.update({
where: { id: account_id},
data: {
name: new_name,
}
});
}
async changeAccountPlan(account_id: number, plan_id: number) {
const plan = await prisma_client.plan.findFirstOrThrow({ where: {id: plan_id}});
return prisma_client.account.update({