StoicWanderer
StoicWanderer
Explore posts from servers
PPrisma
Created by StoicWanderer on 10/1/2024 in #help-and-questions
Tool to write schema by hand
Greetings everyone, I have a quite weird question, does a specific tool exist which i can use to write my prisma schema manually, because i feel too dumb to write my schema manually for my mongodb instance. Thanks
7 replies
KKinde
Created by StoicWanderer on 6/14/2024 in #💻┃support
Hoe can i add a 2 custom fields to the registration component?
Hello, I am using the NextJS sdk, amd i would like to add a select field and an image field to the registration form. Is it possible to customize the component this way?
4 replies
NNuxt
Created by StoicWanderer on 6/8/2024 in #❓・help
Where do i define the createApp instance?
Hello everyone, I am reading through the docs, but it's not clear that where should i define the createApp instance, if I need to add the app.vue entrypoint as parameter to the createApp instance and mount it on #app div?
1 replies
PPrisma
Created by StoicWanderer on 3/17/2024 in #help-and-questions
Does 'asc' sorting order sorts my createdAt timestamps from the oldest to the latest or viceversa?
Hello everyone, I want to sort my MySQL records by the createdAt timestamp, so if I specify the orderBy to be asc, then will it sort the records from the oldest to the latest or vice-versa? Thanks in advance?
3 replies
CCConvex Community
Created by StoicWanderer on 11/24/2023 in #support-community
getUserIdentity can't see I'm logged in with Clerk
Hello everyone, I already cleared the cookies anc cache, but it's randomly throws that I am calling my Convex query without authentication present. I copied the getUserIdentity example from the docs (https://docs.convex.dev/auth/database-auth#storeuser-mutation), but once, it's working, once it throws the error and it's driving me nuts. Can some explain what i'might be doing wrong or is this a bug?
2 replies
CCConvex Community
Created by StoicWanderer on 11/19/2023 in #support-community
getUserIdentity problem!
Hello everyone, My concern is about ctx.auth.getUserIdentity, meaning i dont understand when does this function get the user data from Clerk? I sign-up and i call the storeUser function example from the docs, but i call it in a nextjs client component with useEffect and says i'm not authenticated. It worked once when i tried in an if block with useConvexAuth's isAuthenticated, but it's not working anymore. Also tried using in the if block with Clerk's isSignedIn, same, for one signup worked, then next instance not working How could i solve this?
6 replies
CCConvex Community
Created by StoicWanderer on 11/16/2023 in #support-community
What should I define here, if i want to reference another table by ID?
Hello fellow Convexers, My question is that, because i can't figure it out, what should I put on Line#59, here: https://github.com/andrejmoltok/oceans5/blob/O5T-6-Userlist-Convex-RW/convex/users.ts#L59 if I have defined the table in my schema as is on Line#52 here: https://github.com/andrejmoltok/oceans5/blob/O5T-6-Userlist-Convex-RW/convex/schema.ts#L52 Typescript says it cannot be assigned as string nor viceversa. what comes on line 59 in the users.ts file? Can anyone help please?
6 replies
CCConvex Community
Created by StoicWanderer on 11/14/2023 in #support-community
Auth error while using useQuery
Hello Convex users and Team, My setup is Convex with Clerk authentication. I have a sign-up rpocess after which the use is being redirected to /rules page, inside which I have this piece of code: const agreedCheck = useQuery(api.users.readUserById). I am also using Next.js, which shows me the error, that the Convex function, getUserIdentity doesn't return any logged in users, although i followed every setup piece on both Convex and Clerk, so after sign-up there must be at least one user logged in, according to Clerk. The error comes up even after refreshing the page or after redirecting the user from the sign-up page or after signing out with Clerk's Userbutton component(afterSignOutUrl="/"). My question is, that how should i use this Hook? is it called even when being defined as before I mentioned it, at least it seems that the useQuery hook calls my Convex function as early as being defined, like this: const agreedCheck = useQuery(api.users.readUserById). How can i solve this?
3 replies
CCConvex Community
Created by StoicWanderer on 11/12/2023 in #support-community
db.patch should leave existing fields unmodified
Hello Convex people, My problem is that I want to patch some document fields in my DB and it would be nice to don't make an extra query of my existing data in order to leave them as they are, so that I can use the db.patch function to add new fields to my documents. What doyou think, can that be feasible to make the db.patch to leave the existing fields intact?
8 replies
CCConvex Community
Created by StoicWanderer on 11/10/2023 in #support-community
How do i search users by id?
Hello fellow Convex users, I am extremely beginner with Convex and can't really wrap my head around the whole things' mechanics. I am using Clerk as authentication and I am saving the logged in user into my Convex database fro later. I know that Convex automatically generates an ID for the logged in user, but how do i read that id after the user logs in, so that i can retreive the usr data with queries from the batabase? Can anyone help out, please?
2 replies
CCConvex Community
Created by StoicWanderer on 10/30/2023 in #support-community
How to make authenticated calls to mutations and queries?
Hello people, I am creating a game in next.js and using Convex for it, plust Clerk for website authentication. My question is, tha do i need to check or make authenticated calls for mutations and queries, when for exmaple I want to send the Chat messages, users will write in the Chat functionality, to Convex database? Does the ctx.auth object have other possibilities other than getUserIdentity? Or maybe I'm viewing it from the wrong angle, about how to use authentication in Convex queries and mutaitons. If so, is there an exmaple for this, which could help me wrap my head around it?
18 replies
KPCKevin Powell - Community
Created by StoicWanderer on 10/1/2023 in #front-end
Regex pattern returns true, while inside function returns false
Hello everyone, I am working on a little project to dive deeper into HTML,CSS and Javascript and I came across rpoblem in one of my functions, where I use a fully working regex pattern. I tested it in console.log, it always returns true for the strings i am checking. Here is the pattern:
const regex = /^[\p{L}\s]+$/giu;
const regex = /^[\p{L}\s]+$/giu;
Now my function in which i am using it always returns true, according to console.log. Here is the code for the function:
function validateFirstName(firstName) {
const regex = /^[\p{L}\s]+$/giu;
console.log(firstName);
console.log('firstname validation with regex',regex.test(firstName));
return regex.test(firstName);
};
function validateFirstName(firstName) {
const regex = /^[\p{L}\s]+$/giu;
console.log(firstName);
console.log('firstname validation with regex',regex.test(firstName));
return regex.test(firstName);
};
Is there something I don't understand here, because when i run the following if statement or simply logging the validateFirstName function, it returns false, regardless the regex pattern. Here is how i checked:
console.log('Before validateForm');

if (!validateFirstName(firstName)) {
console.log('Validation failed');
alert('First Name must consist of letters and/or spaces');
return false;
}

console.log('Validation passed');
console.log('Before validateForm');

if (!validateFirstName(firstName)) {
console.log('Validation failed');
alert('First Name must consist of letters and/or spaces');
return false;
}

console.log('Validation passed');
58 replies
CCConvex Community
Created by StoicWanderer on 9/24/2023 in #support-community
How to use isAuthenticated and Convex mutation in Next.js?
I want to finish my hackathon entry, although I didn't have time to submit anything, so, I use Auth0 in my project and i can't use useEffect because i have isAuthenticated in my navbar in 2 places to verify if the user is logged in or not, because this way when I wanto mutate the user data into my Convex database I receive 2 or 3 entries which is not what I want for ONE single user. https://github.com/andrejmoltok/oceans5/tree/main/src/pages/components
3 replies
CCConvex Community
Created by StoicWanderer on 9/16/2023 in #support-community
What properties does the {user} object have when using useAuth0()?
Hi team, I am using Auth0 to login with Github account and i would like to return their usernames from Github as well, not only their set names on their profile. That's why I'm asking what other properties tdoes the {user} object have, so that I could access the github username as well. I tried {user?.username}, but the response was empty.
1 replies
KPCKevin Powell - Community
Created by StoicWanderer on 9/3/2023 in #front-end
How to create a custom calendar in Javascript(Next.js)
Hello team, I have started creating a custom calendar, fetching data from a CMS I use and displaying it in NExt.js. I am stuck at the point where I need to adjust the displayed days to ending of the previous month. How can i display it in an HTML tbale to start counting from where the last month has ended. Each month has 32-33 days. I've got to the point where I can display the days correctly, but how do i adjust that when the last month ends on the 4th day of the week, then the next month starts at the 5day of the week?
7 replies
KPCKevin Powell - Community
Created by StoicWanderer on 4/23/2023 in #front-end
Z-indexnot working on pseudo-elements
Hello team, I am working on some pseudo-elements with backgroung-images, and my problem is that no matter if i set the ::before and the ::after with pisition: absolute and z-index lower than the parent element, they don't go under the parent element covering my patent element. Why is that? And how can i solve it?
.tartkozep::before {
content: " ";
display: block;
width: 100%;
height: 100%;
position: absolute;
top: -20px;
z-index: -1;
background-image: url('/tart-szel.jpg');
background-repeat: no-repeat;
background-size: contain;
}

.tartkozep::after {
content: " ";
display: block;
width: 100%;
height: 100%;
position: absolute;
top: 350px;
z-index: -1;
background-image: url('/tart-szel.jpg');
background-repeat: no-repeat;
background-size: contain;
}

.tartkozep {
margin: 0 0;
width: 100%;
position: relative;
top: 20px;
left: 0px;
z-index: 1;
background-image: url('/tart-kozep.jpg');
background-size: contain;
background-repeat: repeat-y;
height: 420px;
}
.tartkozep::before {
content: " ";
display: block;
width: 100%;
height: 100%;
position: absolute;
top: -20px;
z-index: -1;
background-image: url('/tart-szel.jpg');
background-repeat: no-repeat;
background-size: contain;
}

.tartkozep::after {
content: " ";
display: block;
width: 100%;
height: 100%;
position: absolute;
top: 350px;
z-index: -1;
background-image: url('/tart-szel.jpg');
background-repeat: no-repeat;
background-size: contain;
}

.tartkozep {
margin: 0 0;
width: 100%;
position: relative;
top: 20px;
left: 0px;
z-index: 1;
background-image: url('/tart-kozep.jpg');
background-size: contain;
background-repeat: repeat-y;
height: 420px;
}
4 replies