Fix more types and use logical ANDs
This commit is contained in:
@@ -71,7 +71,7 @@ export default async function getDashboardData(
|
||||
});
|
||||
|
||||
const links = [...recentlyAddedLinks, ...pinnedLinks].sort(
|
||||
(a, b) => (new Date(b.id) as any) - (new Date(a.id) as any)
|
||||
(a, b) => new Date(b.id).getTime() - new Date(a.id).getTime()
|
||||
);
|
||||
|
||||
return { response: links, status: 200 };
|
||||
|
||||
@@ -105,9 +105,8 @@ export default async function getDashboardData(
|
||||
});
|
||||
|
||||
const links = [...recentlyAddedLinks, ...pinnedLinks].sort(
|
||||
(a, b) => (new Date(b.id) as any) - (new Date(a.id) as any)
|
||||
(a, b) => new Date(b.id).getTime() - new Date(a.id).getTime()
|
||||
);
|
||||
|
||||
return {
|
||||
data: {
|
||||
links,
|
||||
|
||||
@@ -29,7 +29,7 @@ export default async function createSession(
|
||||
secret: process.env.NEXTAUTH_SECRET as string,
|
||||
});
|
||||
|
||||
const createToken = await prisma.accessToken.create({
|
||||
await prisma.accessToken.create({
|
||||
data: {
|
||||
name: sessionName || "Unknown Device",
|
||||
userId,
|
||||
|
||||
@@ -26,7 +26,7 @@ export default async function deleteUserById(
|
||||
if (user.password) {
|
||||
const isPasswordValid = bcrypt.compareSync(
|
||||
body.password,
|
||||
user.password as string
|
||||
user.password
|
||||
);
|
||||
|
||||
if (!isPasswordValid && !isServerAdmin) {
|
||||
|
||||
Reference in New Issue
Block a user