AmazingViegas
AmazingViegas
Explore posts from servers
PPrisma
Created by AmazingViegas on 1/15/2025 in #help-and-questions
Query works but getting a TS error
Hello! I wrote a query that is working but I am getting a Typescript error that I cannot debug. Could someone more experienced tell me what this could be about? Of course I don't want you to work for me. Not looking for help solving the problem, just some steering on the right direction. Thank you so much in advance. Query:
await database.play.create({
data: {
date: new Date(gameSchema.datePlayed),
location: gameSchema.location,
duration: gameSchema.durationMinutes,
notes: gameSchema.extra,
userId: user.id,
game: {
connect: { id: gameSchema.gameId }, // Assuming gameId corresponds to the Game model's id
},
players: {
create: [
...gameSchema.players.map((player) => ({
player: {
connectOrCreate: {
where: {
OwnerIdBggUsername: {
ownerId: user.id,
bggUsername: player.bggUsername,
},
},
create: {
name: player.name,
bggUsername: player.bggUsername,
ownerId: user.id,
},
},
},
team: player.team,
score: player.score,
winner: player.won,
firstTime: player.firstTime,
})),
],
},
},
});
await database.play.create({
data: {
date: new Date(gameSchema.datePlayed),
location: gameSchema.location,
duration: gameSchema.durationMinutes,
notes: gameSchema.extra,
userId: user.id,
game: {
connect: { id: gameSchema.gameId }, // Assuming gameId corresponds to the Game model's id
},
players: {
create: [
...gameSchema.players.map((player) => ({
player: {
connectOrCreate: {
where: {
OwnerIdBggUsername: {
ownerId: user.id,
bggUsername: player.bggUsername,
},
},
create: {
name: player.name,
bggUsername: player.bggUsername,
ownerId: user.id,
},
},
},
team: player.team,
score: player.score,
winner: player.won,
firstTime: player.firstTime,
})),
],
},
},
});
8 replies
TTCTheo's Typesafe Cult
Created by AmazingViegas on 2/19/2024 in #questions
Shadcn Toast not showing using useEffect
Hello. I am trying to render a shadcn toast after a redirect from a server action, but first, I need to be able to render a toast on page load.
export default function Page() {
const { toast } = useToast();
useEffect(() => {
console.log("hello");
toast({
title: "Test",
description: "Test",
});
}, [toast]);
export default function Page() {
const { toast } = useToast();
useEffect(() => {
console.log("hello");
toast({
title: "Test",
description: "Test",
});
}, [toast]);
I can't figure out why this does not work... anyone here that has used this library might help? Thanks in advance!
10 replies
TTCTheo's Typesafe Cult
Created by AmazingViegas on 10/11/2023 in #questions
Indie Hackers in here, how do you usually apply for Google Auth and get approved fast?
I am creating a web app. For now I am still building it but I need Google Auth ready the moment I launch the app. When creating a startup/web app what is your process when applying for Google Auth?
2 replies