! AlexNotTheLion
! AlexNotTheLion
Explore posts from servers
TTCTheo's Typesafe Cult
Created by ! AlexNotTheLion on 6/21/2024 in #questions
In Nextjs how do you set serachParams in middleware ?
Yup same response as above, doesn't have the search params as far as I can tell
17 replies
TTCTheo's Typesafe Cult
Created by ! AlexNotTheLion on 6/21/2024 in #questions
In Nextjs how do you set serachParams in middleware ?
the first thing the createClient method does it create an unmodified response like so, so i expect that takes out all the params ?
export const createClient = (request: NextRequest) => {
// Create an unmodified response
let response = NextResponse.next({
request: {
headers: request.headers,
},
});
export const createClient = (request: NextRequest) => {
// Create an unmodified response
let response = NextResponse.next({
request: {
headers: request.headers,
},
});
17 replies
TTCTheo's Typesafe Cult
Created by ! AlexNotTheLion on 6/21/2024 in #questions
In Nextjs how do you set serachParams in middleware ?
if i add the params manuall like localhost:3000/events?test=abc , the params stay
17 replies
TTCTheo's Typesafe Cult
Created by ! AlexNotTheLion on 6/21/2024 in #questions
In Nextjs how do you set serachParams in middleware ?
but i have also checked getting the params in a server component and they do get removed
17 replies
TTCTheo's Typesafe Cult
Created by ! AlexNotTheLion on 6/21/2024 in #questions
In Nextjs how do you set serachParams in middleware ?
No description
17 replies
TTCTheo's Typesafe Cult
Created by ! AlexNotTheLion on 6/21/2024 in #questions
In Nextjs how do you set serachParams in middleware ?
sorry for the long reply, window 10 terminal is being a pain and putting things in objects, heres the output
request : "http://localhost:3000/?viewport=desktop"
response : ""
request : "http://localhost:3000/?viewport=desktop"
response : ""
17 replies
TTCTheo's Typesafe Cult
Created by ! AlexNotTheLion on 6/21/2024 in #questions
In Nextjs how do you set serachParams in middleware ?
sorry forgot to press reply ^
17 replies
TTCTheo's Typesafe Cult
Created by ! AlexNotTheLion on 6/21/2024 in #questions
In Nextjs how do you set serachParams in middleware ?
No description
17 replies
TTCTheo's Typesafe Cult
Created by ! AlexNotTheLion on 6/21/2024 in #questions
In Nextjs how do you set serachParams in middleware ?
thats fine, the issue im currently seeing is the params im setting are not appearing in the url if the user is authenticated
17 replies
TTCTheo's Typesafe Cult
Created by ! AlexNotTheLion on 6/21/2024 in #questions
In Nextjs how do you set serachParams in middleware ?
bump
17 replies
DTDrizzle Team
Created by ! AlexNotTheLion on 4/2/2024 in #help
friendship query that returns the other user object
updated! thank you kindly 🙂
8 replies
DTDrizzle Team
Created by ! AlexNotTheLion on 4/2/2024 in #help
friendship query that returns the other user object
const user = data.user;

const queryResult = await db
.select({
id: friendships.id,
status: friendships.status,
incoming: sql<boolean>`friendship.receiving_user = ${user.id}`,
profile: {
id: profiles.id,
username: profiles.username,
avatarUrl: profiles.avatarUrl
}
}).from(friendships).innerJoin(profiles, sql`(
friendship.sending_user != ${user.id}
AND friendship.sending_user = profile.id
) OR (
friendship.receiving_user != ${user.id}
AND friendship.receiving_user = profile.id
)`)
.where(sql`friendship.sending_user = ${user.id} OR friendship.receiving_user = ${user.id}`);
const user = data.user;

const queryResult = await db
.select({
id: friendships.id,
status: friendships.status,
incoming: sql<boolean>`friendship.receiving_user = ${user.id}`,
profile: {
id: profiles.id,
username: profiles.username,
avatarUrl: profiles.avatarUrl
}
}).from(friendships).innerJoin(profiles, sql`(
friendship.sending_user != ${user.id}
AND friendship.sending_user = profile.id
) OR (
friendship.receiving_user != ${user.id}
AND friendship.receiving_user = profile.id
)`)
.where(sql`friendship.sending_user = ${user.id} OR friendship.receiving_user = ${user.id}`);
8 replies
DTDrizzle Team
Created by ! AlexNotTheLion on 4/2/2024 in #help
friendship query that returns the other user object
for anyone coming across this in the future, this is the query that i ended up using
8 replies
DTDrizzle Team
Created by ! AlexNotTheLion on 4/2/2024 in #help
friendship query that returns the other user object
Not particularly what I was looking for, but thank you for your Insightful response
8 replies
DTDrizzle Team
Created by ! AlexNotTheLion on 2/19/2024 in #help
(Solved) Filter where json array contains
Agreed!
6 replies
DTDrizzle Team
Created by ! AlexNotTheLion on 2/19/2024 in #help
(Solved) Filter where json array contains
NAILED IT! thank you that was driving me nuts! i tried to use json contains but i wasnt stringifying the user id i passed to it !
6 replies
DTDrizzle Team
Created by ! AlexNotTheLion on 11/7/2023 in #help
[Solved] cannot find package 'mysql2'
nevermind, solved it by installing mysql2, apparently this is a known bug
2 replies