diff --git a/src/api/users.ts b/src/api/users.ts index e85cb61..db8f58c 100644 --- a/src/api/users.ts +++ b/src/api/users.ts @@ -21,14 +21,12 @@ export interface Profile { note: string | null; avatar: string | null; header: string | null; - identity_proofs: ProfileField[], + identity_proofs: ProfileField[]; fields: ProfileField[]; followers_count: number; following_count: number; statuses_count: number; - - source: Source | null; } export function getVerifiedEthereumAddress(profile: Profile): string | null { @@ -45,6 +43,23 @@ export interface User extends Profile { wallet_address: string | null; } +export interface ProfileWrapper extends Profile {} +export class ProfileWrapper { + + constructor(source: Profile) { + Object.assign(this, source) + } + + getDisplayName(): string { + return this.display_name || this.username + } + + getVerifiedEthereumAddress(): string | null { + return getVerifiedEthereumAddress(this) + } + +} + export interface UserCreateForm { username: string; message: string; diff --git a/src/components/Subscription.vue b/src/components/Subscription.vue index c36ae6b..fdc20e9 100644 --- a/src/components/Subscription.vue +++ b/src/components/Subscription.vue @@ -39,7 +39,7 @@