bockster6669
bockster6669
Explore posts from servers
PPrisma
Created by bockster6669 on 9/11/2024 in #help-and-questions
Search text with Prisma
hi, thank you, but can you help for this now? I am having strange problem, why when formattedQuery is undefined it doesn't finds any posts, but if I refer directly undefined to search then it finds all posts?
const formattedQuery = formatSearchQuery(searchInputParam);

try {
const posts = await PostRepo.findMany({
where: {
title: {
search: formattedQuery,
},
},
const formattedQuery = formatSearchQuery(searchInputParam);

try {
const posts = await PostRepo.findMany({
where: {
title: {
search: formattedQuery,
},
},
For example* I can use
orderBy: {
createdAt: undefined,
}
orderBy: {
createdAt: undefined,
}
and this will work find, the posts will not be sorted by any mean but I can not use
const variable = undefined
orderBy: {
createdAt: variable ,
}
const variable = undefined
orderBy: {
createdAt: variable ,
}
This will not work! I am getting error:
Error occurred while fetching posts: PrismaClientValidationError:
Invalid `prisma.post.findMany()` invocation:

{
where: {
title: {
search: "undefined"
}
},
include: {
author: true,
tags: true,
comments: {
include: {
author: true
}
}
},
orderBy: {
createdAt: "undefined"
~~~~~~~~~~~
}
}
Error occurred while fetching posts: PrismaClientValidationError:
Invalid `prisma.post.findMany()` invocation:

{
where: {
title: {
search: "undefined"
}
},
include: {
author: true,
tags: true,
comments: {
include: {
author: true
}
}
},
orderBy: {
createdAt: "undefined"
~~~~~~~~~~~
}
}
4 replies
PPrisma
Created by bockster6669 on 9/3/2024 in #help-and-questions
Prisma Types
PostModel.findMany return only Post[] instead of Post[] & Tag: {name: string}
6 replies
PPrisma
Created by bockster6669 on 9/3/2024 in #help-and-questions
Prisma Types
PostFindUniqueResult is the correct type, but PostModel.findMany doesnt return it
6 replies
PPrisma
Created by bockster6669 on 9/3/2024 in #help-and-questions
Prisma Types
same as this one and so on
type PostFindManyResult = Prisma.Result<
typeof db.post,
{
include: {
tags: {
select: {
name: true,
},
},
},
},
'findMany'
>;

const posts:PostFindManyResult = await PostModel.findMany({
include: {
tags: {
select: {
name: true,
},
},
},
});
type PostFindManyResult = Prisma.Result<
typeof db.post,
{
include: {
tags: {
select: {
name: true,
},
},
},
},
'findMany'
>;

const posts:PostFindManyResult = await PostModel.findMany({
include: {
tags: {
select: {
name: true,
},
},
},
});
6 replies
PPrisma
Created by bockster6669 on 8/31/2024 in #help-and-questions
is there a `substring` method in prisma?
yea I know, this doens't fix the bigger network traffic
7 replies
PPrisma
Created by bockster6669 on 8/31/2024 in #help-and-questions
is there a `substring` method in prisma?
I just want to take the first 50 characters of a sentance
7 replies
KPCKevin Powell - Community
Created by bockster6669 on 7/26/2024 in #front-end
What Figma says
thank you
17 replies
KPCKevin Powell - Community
Created by bockster6669 on 7/24/2024 in #front-end
How to make a child element fixed but in the same time relative
it starts glitching and the obeserver function is called hudrend times
43 replies
KPCKevin Powell - Community
Created by bockster6669 on 7/24/2024 in #front-end
How to make a child element fixed but in the same time relative
43 replies
KPCKevin Powell - Community
Created by bockster6669 on 7/24/2024 in #front-end
How to make a child element fixed but in the same time relative
also can you tell me how this should work, because if I make it 1 for example and it starts glitching
43 replies
KPCKevin Powell - Community
Created by bockster6669 on 7/24/2024 in #front-end
How to make a child element fixed but in the same time relative
I mean, there is no result like 10px before it, I want to adjust it strictly
43 replies
KPCKevin Powell - Community
Created by bockster6669 on 7/24/2024 in #front-end
How to make a child element fixed but in the same time relative
any result
43 replies
KPCKevin Powell - Community
Created by bockster6669 on 7/24/2024 in #front-end
How to make a child element fixed but in the same time relative
I tried but there is no result
43 replies
KPCKevin Powell - Community
Created by bockster6669 on 7/24/2024 in #front-end
How to make a child element fixed but in the same time relative
No description
43 replies
KPCKevin Powell - Community
Created by bockster6669 on 7/24/2024 in #front-end
How to make a child element fixed but in the same time relative
this is what I mean
43 replies
KPCKevin Powell - Community
Created by bockster6669 on 7/24/2024 in #front-end
How to make a child element fixed but in the same time relative
the problerm is that, the nav becomes fixed when I scroll little after it, instead of little before it
43 replies
KPCKevin Powell - Community
Created by bockster6669 on 7/24/2024 in #front-end
How to make a child element fixed but in the same time relative
No description
43 replies
KPCKevin Powell - Community
Created by bockster6669 on 7/24/2024 in #front-end
How to make a child element fixed but in the same time relative
No description
43 replies
KPCKevin Powell - Community
Created by bockster6669 on 7/24/2024 in #front-end
How to make a child element fixed but in the same time relative
thank you for the code snipe, it works, but needs a little shaping and I don't know exactly how, can you help me
43 replies