mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
feat(contacts): add company field to free contacts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
a430aa1910
commit
693d9460cb
4 files changed
+21
No files matched your search
@@ -49,6 +49,7 @@ export default function Contacts() {
|
||||
const [formData, setFormData] = useState({
|
||||
groupId: effectiveGroupId ?? 0,
|
||||
name: "",
|
||||
company: "",
|
||||
role: "",
|
||||
phone: "",
|
||||
email: "",
|
||||
@@ -135,6 +136,7 @@ export default function Contacts() {
|
||||
setFormData({
|
||||
groupId: effectiveGroupId ?? 0,
|
||||
name: "",
|
||||
company: "",
|
||||
role: "",
|
||||
phone: "",
|
||||
email: "",
|
||||
@@ -148,6 +150,7 @@ export default function Contacts() {
|
||||
setFormData({
|
||||
groupId: contact.groupId,
|
||||
name: contact.name,
|
||||
company: (contact as any).company || "",
|
||||
role: contact.role || "",
|
||||
phone: contact.phone || "",
|
||||
email: contact.email || "",
|
||||
@@ -384,6 +387,9 @@ export default function Contacts() {
|
||||
</div>
|
||||
<div>
|
||||
<p className="font-semibold text-gray-900">{contact.name}</p>
|
||||
{(contact as any).company && (
|
||||
<p className="text-sm font-medium text-gray-700">{(contact as any).company}</p>
|
||||
)}
|
||||
{contact.role && (
|
||||
<p className="text-sm text-gray-500">{contact.role}</p>
|
||||
)}
|
||||
@@ -485,6 +491,16 @@ export default function Contacts() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Label htmlFor="c-company">Entreprise</Label>
|
||||
<Input
|
||||
id="c-company"
|
||||
value={formData.company}
|
||||
onChange={(e) => setFormData((p) => ({ ...p, company: e.target.value }))}
|
||||
placeholder="Nom de l'entreprise"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Label htmlFor="c-role">Fonction / Rôle</Label>
|
||||
<Input
|
||||
|
||||
@@ -19,3 +19,6 @@ CREATE TABLE IF NOT EXISTS contacts (
|
||||
|
||||
-- Index pour recherche rapide par magasin
|
||||
CREATE INDEX IF NOT EXISTS idx_contacts_group_id ON contacts(group_id);
|
||||
|
||||
-- Ajout du champ entreprise sur les contacts
|
||||
ALTER TABLE contacts ADD COLUMN IF NOT EXISTS company VARCHAR(255);
|
||||
@@ -3616,6 +3616,7 @@ export class MemStorage implements IStorage {
|
||||
id,
|
||||
groupId: contactData.groupId,
|
||||
name: contactData.name,
|
||||
company: contactData.company || null,
|
||||
role: contactData.role || null,
|
||||
phone: contactData.phone || null,
|
||||
email: contactData.email || null,
|
||||
|
||||
@@ -95,6 +95,7 @@ export const contacts = pgTable("contacts", {
|
||||
id: serial("id").primaryKey(),
|
||||
groupId: integer("group_id").notNull(),
|
||||
name: varchar("name").notNull(),
|
||||
company: varchar("company"),
|
||||
role: varchar("role"),
|
||||
phone: varchar("phone"),
|
||||
email: varchar("email"),
|
||||
|
||||
Reference in new issue
Block a user