Add profile completion checker
cgen-b50e9bd57c724cf19c901f9d01ef0cf6
This commit is contained in:
parent
76f9494548
commit
175c22c348
1 changed files with 9 additions and 0 deletions
|
|
@ -20,6 +20,15 @@ export interface AethexUserProfile extends UserProfile {
|
||||||
skills?: string[];
|
skills?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function checkProfileComplete(p?: AethexUserProfile | null): boolean {
|
||||||
|
if (!p) return false;
|
||||||
|
const hasUsername = typeof p.username === "string" && p.username.trim().length > 0;
|
||||||
|
const hasFullName = typeof p.full_name === "string" && p.full_name.trim().length > 0;
|
||||||
|
const hasUserType = typeof (p as any).user_type === "string" && (p as any).user_type.trim().length > 0;
|
||||||
|
const hasExperience = typeof (p as any).experience_level === "string" && (p as any).experience_level.trim().length > 0;
|
||||||
|
return hasUsername && hasFullName && hasUserType && hasExperience;
|
||||||
|
}
|
||||||
|
|
||||||
export interface AethexProject {
|
export interface AethexProject {
|
||||||
id: string;
|
id: string;
|
||||||
user_id: string;
|
user_id: string;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue