adrianhajdin / ai_saas_app

Build a REAL Software-as-a-Service app with AI features and payments & credits system that you might even turn into a side income or business idea using Next.js 14, Clerk, MongoDB, Cloudinary AI, and Stripe.

Home Page:https://jsmastery.pro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

praveshtiwari150 opened this issue · comments

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)

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?;
};

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