diff --git a/apps/manacore/apps/web/src/lib/modules/contacts/stores/contacts.svelte.ts b/apps/manacore/apps/web/src/lib/modules/contacts/stores/contacts.svelte.ts index 270d37901..8b1b1cfed 100644 --- a/apps/manacore/apps/web/src/lib/modules/contacts/stores/contacts.svelte.ts +++ b/apps/manacore/apps/web/src/lib/modules/contacts/stores/contacts.svelte.ts @@ -10,18 +10,28 @@ import { toContact } from '../queries'; import type { LocalContact, Contact } from '../types'; export const contactsStore = { - async createContact(data: Partial) { + async createContact(data: Partial & Record) { const newLocal: LocalContact = { id: crypto.randomUUID(), firstName: data.firstName ?? undefined, lastName: data.lastName ?? undefined, email: data.email ?? undefined, phone: data.phone ?? undefined, + mobile: (data.mobile as string) ?? undefined, company: data.company ?? undefined, jobTitle: data.jobTitle ?? undefined, + street: (data.street as string) ?? undefined, + city: (data.city as string) ?? undefined, + postalCode: (data.postalCode as string) ?? undefined, + country: (data.country as string) ?? undefined, notes: data.notes ?? undefined, photoUrl: data.photoUrl ?? undefined, birthday: data.birthday ?? undefined, + linkedin: (data.linkedin as string) ?? undefined, + twitter: (data.twitter as string) ?? undefined, + instagram: (data.instagram as string) ?? undefined, + github: (data.github as string) ?? undefined, + website: (data.website as string) ?? undefined, tags: data.tags?.map((t) => t.name) ?? [], isFavorite: false, isArchived: false, diff --git a/apps/manacore/apps/web/src/lib/modules/contacts/types.ts b/apps/manacore/apps/web/src/lib/modules/contacts/types.ts index b882fcc0a..249db579b 100644 --- a/apps/manacore/apps/web/src/lib/modules/contacts/types.ts +++ b/apps/manacore/apps/web/src/lib/modules/contacts/types.ts @@ -9,12 +9,22 @@ export interface LocalContact extends BaseRecord { lastName?: string; email?: string; phone?: string; + mobile?: string; company?: string; jobTitle?: string; + street?: string; + city?: string; + postalCode?: string; + country?: string; address?: string; notes?: string; photoUrl?: string; birthday?: string; + linkedin?: string; + twitter?: string; + instagram?: string; + github?: string; + website?: string; tags?: string[]; tagIds?: string[]; isFavorite?: boolean; diff --git a/apps/manacore/apps/web/src/routes/(app)/contacts/+page.svelte b/apps/manacore/apps/web/src/routes/(app)/contacts/+page.svelte index b448bc6bc..bb54cf88d 100644 --- a/apps/manacore/apps/web/src/routes/(app)/contacts/+page.svelte +++ b/apps/manacore/apps/web/src/routes/(app)/contacts/+page.svelte @@ -27,6 +27,11 @@ PencilSimple, Funnel, Users, + User, + Envelope, + Briefcase, + MapPin, + X, } from '@manacore/shared-icons'; // Get contacts from layout context @@ -317,78 +322,184 @@ {#if contactModalStore.isOpen} {@const isEditing = !!contactModalStore.editContactId} +