mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
use uuid
This commit is contained in:
parent
246e4e5f4f
commit
17041efaae
73 changed files with 491 additions and 874 deletions
|
|
@ -13,9 +13,9 @@ const runQuery = async query => {
|
|||
});
|
||||
};
|
||||
|
||||
const updateAccountByUsername = (username, data) => {
|
||||
const updateUserByUsername = (username, data) => {
|
||||
return runQuery(
|
||||
prisma.account.update({
|
||||
prisma.user.update({
|
||||
where: {
|
||||
username,
|
||||
},
|
||||
|
|
@ -26,7 +26,7 @@ const updateAccountByUsername = (username, data) => {
|
|||
|
||||
const changePassword = async (username, newPassword) => {
|
||||
const password = hashPassword(newPassword);
|
||||
return updateAccountByUsername(username, { password });
|
||||
return updateUserByUsername(username, { password });
|
||||
};
|
||||
|
||||
const getUsernameAndPassword = async () => {
|
||||
|
|
@ -40,7 +40,7 @@ const getUsernameAndPassword = async () => {
|
|||
questions.push({
|
||||
type: 'text',
|
||||
name: 'username',
|
||||
message: 'Enter account to change password',
|
||||
message: 'Enter user to change password',
|
||||
});
|
||||
}
|
||||
if (!password) {
|
||||
|
|
@ -84,7 +84,7 @@ const getUsernameAndPassword = async () => {
|
|||
console.log('Password changed for user', chalk.greenBright(username));
|
||||
} catch (error) {
|
||||
if (error.meta.cause.includes('Record to update not found')) {
|
||||
console.log('Account not found:', chalk.redBright(username));
|
||||
console.log('User not found:', chalk.redBright(username));
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ async function checkConnection() {
|
|||
|
||||
async function checkTables() {
|
||||
try {
|
||||
await prisma.$queryRaw`select * from account limit 1`;
|
||||
await prisma.$queryRaw`select * from user limit 1`;
|
||||
|
||||
success('Database tables found.');
|
||||
} catch (e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue