Revaycolizer
Revaycolizer
Explore posts from servers
NNuxt
Created by Revaycolizer on 11/2/2024 in #❓・help
My UI won't update even though I successfully receive response
await refreshNuxtData() works
11 replies
NNuxt
Created by Revaycolizer on 11/2/2024 in #❓・help
My UI won't update even though I successfully receive response
@kapa.ai
11 replies
NNuxt
Created by Revaycolizer on 11/2/2024 in #❓・help
My UI won't update even though I successfully receive response
But below is my API seems it cannot apply to the code you wrote
export default defineEventHandler(async (event) => {
const body = await readBody(event)

const { test, name } = body
if (!test||!name){
return []
}
setResponseStatus(event, 202)

const data =[
{
id:1,
test: test,
name: name
}
]
return data
})
export default defineEventHandler(async (event) => {
const body = await readBody(event)

const { test, name } = body
if (!test||!name){
return []
}
setResponseStatus(event, 202)

const data =[
{
id:1,
test: test,
name: name
}
]
return data
})
11 replies
TTCTheo's Typesafe Cult
Created by Revaycolizer on 9/8/2023 in #questions
Football live Stream Package
I'll try it
8 replies
TTCTheo's Typesafe Cult
Created by Revaycolizer on 9/8/2023 in #questions
Football live Stream Package
How can I get it's API keys?
8 replies
TTCTheo's Typesafe Cult
Created by Revaycolizer on 9/8/2023 in #questions
Football live Stream Package
Thanks let me try it
8 replies
TTCTheo's Typesafe Cult
Created by Revaycolizer on 9/4/2023 in #questions
Error:localhost redirected too many times
Thanks fixed it already
4 replies
TTCTheo's Typesafe Cult
Created by Revaycolizer on 9/5/2023 in #questions
Some of the conditions are omitted in middleware
Fixed already
6 replies
TTCTheo's Typesafe Cult
Created by Revaycolizer on 9/5/2023 in #questions
Implementing Middleware
Fixed
3 replies
TTCTheo's Typesafe Cult
Created by Revaycolizer on 9/2/2023 in #questions
Implementing get Request with Prisma
export async function GET(req: Request, res: NextResponse) {

const member = await redis.get("user")

const useri = JSON.stringify(member)

const usr = JSON.parse(useri)

if(!usr || !member){
return new Response("No user found", {status:404})
}

try {

const user = await prisma.user.findFirst({
where:{
email: usr.email,
ustate: "NON_BLOCKED",
},
select:{
email:true,
role:true,
image:true,
name:true,
}
})

return NextResponse.json(user);

} catch (error) {
console.error("Error retrieving user token:", error);
return new NextResponse("Internal Error", { status: 500 });
}
}
export async function GET(req: Request, res: NextResponse) {

const member = await redis.get("user")

const useri = JSON.stringify(member)

const usr = JSON.parse(useri)

if(!usr || !member){
return new Response("No user found", {status:404})
}

try {

const user = await prisma.user.findFirst({
where:{
email: usr.email,
ustate: "NON_BLOCKED",
},
select:{
email:true,
role:true,
image:true,
name:true,
}
})

return NextResponse.json(user);

} catch (error) {
console.error("Error retrieving user token:", error);
return new NextResponse("Internal Error", { status: 500 });
}
}
3 replies
TTCTheo's Typesafe Cult
Created by Revaycolizer on 8/31/2023 in #questions
Implementing login with Prisma
@xchristoph the comparison works thanks
20 replies
TTCTheo's Typesafe Cult
Created by Revaycolizer on 8/31/2023 in #questions
Implementing login with Prisma
I once used it but when tried consuming the API in for login in another frameworks it didn't work out
20 replies