Skip to content

Commit

Permalink
a couple fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed Aug 30, 2023
1 parent f537a2c commit 74ee414
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
6 changes: 2 additions & 4 deletions app/routes/_auth+/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ export async function handleNewSession(
combineResponseInits(
{
headers: {
'set-cookie': await verifySessionStorage.commitSession(
verifySession,
),
'set-cookie':
await verifySessionStorage.commitSession(verifySession),
},
},
responseInit,
Expand Down Expand Up @@ -261,7 +260,6 @@ export default function LoginPage() {
<div>
<div className="mx-auto w-full max-w-md px-8">
<Form method="POST" {...form.props}>
<input type="hidden" name="form" value={form.id} />
<Field
labelProps={{ children: 'Username' }}
inputProps={{
Expand Down
1 change: 1 addition & 0 deletions app/routes/users+/$username_+/__note-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ export async function action({ request }: DataFunctionArgs) {
ownerId: userId,
title,
content,
images: { create: newImages },
},
update: {
title,
Expand Down
16 changes: 8 additions & 8 deletions app/routes/users+/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ export async function loader({ request }: DataFunctionArgs) {

const like = `%${searchTerm ?? ''}%`
const rawUsers = await prisma.$queryRaw`
SELECT user.id, user.username, user.name, image.id AS imageId
FROM User AS user
LEFT JOIN UserImage AS image ON user.id = image.userId
WHERE user.username LIKE ${like}
OR user.name LIKE ${like}
SELECT User.id, User.username, User.name, UserImage.id AS imageId
FROM User
LEFT JOIN UserImage ON User.id = UserImage.userId
WHERE User.username LIKE ${like}
OR User.name LIKE ${like}
ORDER BY (
SELECT updatedAt
SELECT Note.updatedAt
FROM Note
WHERE ownerId = user.id
ORDER BY updatedAt DESC
WHERE Note.ownerId = User.id
ORDER BY Note.updatedAt DESC
LIMIT 1
) DESC
LIMIT 50
Expand Down

0 comments on commit 74ee414

Please sign in to comment.