Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

minor fix

Daniel02b7a901603a
diff --git a/lib/api/controllers/users/updateUser.ts b/lib/api/controllers/users/updateUser.ts
index 91674ba1..f9535577 100644
--- a/lib/api/controllers/users/updateUser.ts
+++ b/lib/api/controllers/users/updateUser.ts
@@ -50,9 +50,11 @@ export default async function updateUser(
email: user.email?.toLowerCase(),
},
]
- : {
- username: user.username.toLowerCase(),
- },
+ : [
+ {
+ username: user.username.toLowerCase(),
+ },
+ ],
},
});
@@ -112,27 +114,29 @@ export default async function updateUser(
: undefined,
},
include: {
- whitelistedUsers: true
- }
+ whitelistedUsers: true,
+ },
});
-
const { whitelistedUsers, password, ...userInfo } = updatedUser;
// If user.whitelistedUsers is not provided, we will assume the whitelistedUsers should be removed
const newWhitelistedUsernames: string[] = user.whitelistedUsers || [];
// Get the current whitelisted usernames
- const currentWhitelistedUsernames: string[] = whitelistedUsers.map((user) => user.username);
+ const currentWhitelistedUsernames: string[] = whitelistedUsers.map(
+ (user) => user.username
+ );
// Find the usernames to be deleted (present in current but not in new)
const usernamesToDelete: string[] = currentWhitelistedUsernames.filter(
- (username) => !newWhitelistedUsernames.includes(username)
+ (username) => !newWhitelistedUsernames.includes(username)
);
// Find the usernames to be created (present in new but not in current)
const usernamesToCreate: string[] = newWhitelistedUsernames.filter(
- (username) => !currentWhitelistedUsernames.includes(username) && username.trim() !== ''
+ (username) =>
+ !currentWhitelistedUsernames.includes(username) && username.trim() !== ""
);
// Delete whitelistedUsers that are not present in the new list
@@ -155,7 +159,6 @@ export default async function updateUser(
});
}
-
const STRIPE_SECRET_KEY = process.env.STRIPE_SECRET_KEY;
const PRICE_ID = process.env.PRICE_ID;
diff --git a/lib/api/db.ts b/lib/api/db.ts
index 49e21fa8..01c4c7dc 100644
--- a/lib/api/db.ts
+++ b/lib/api/db.ts
@@ -10,9 +10,10 @@ export const prisma =
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
-if (process.env.NODE_ENV !== "production")
- prisma.$on("query" as any, (e: any) => {
- console.log("Query: " + e.query);
- console.log("Params: " + e.params);
- console.log("\x1b[31m", `Duration: ${e.duration}ms`, "\x1b[0m"); // For benchmarking
- });
+// For benchmarking | uncomment when needed
+// if (process.env.NODE_ENV !== "production")
+// prisma.$on("query" as any, (e: any) => {
+// console.log("Query: " + e.query);
+// console.log("Params: " + e.params);
+// console.log("\x1b[31m", `Duration: ${e.duration}ms`, "\x1b[0m");
+// });