Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument of type '{ firstName: string | null; lastName: string | null; username: string; photo: string; }' is not assignable to parameter #21

Open
praveshtiwari150 opened this issue May 15, 2024 · 2 comments

Comments

@praveshtiwari150
Copy link

Argument of type '{ firstName: string | null; lastName: string | null; username: string; photo: string; }' is not assignable to parameter of type 'UpdateUserParams'.
Types of property 'firstName' are incompatible.
Type 'string | null' is not assignable to type 'string'.
Type 'null' is not assignable to type 'string'.ts(2345)

@GarvitG19
Copy link

Just navigate to index.d.ts in types folder

and do these changes (add a ?)

declare type CreateUserParams = {
clerkId: string?;
email: string?;
username: string?;
firstName: string?;
lastName: string?;
photo: string?;
};

declare type UpdateUserParams = {
firstName: string?;
lastName: string?;
username: string?;
photo: string?;
};

@Drjaickal
Copy link

declare type UpdateUserParams = {
firstName: string | null; // Allow null values for firstName
lastName: string | null;
username: string; // Still required
photo: string;
};
This might work..!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants