mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-22 22:48:15 +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({
|
const [formData, setFormData] = useState({
|
||||||
groupId: effectiveGroupId ?? 0,
|
groupId: effectiveGroupId ?? 0,
|
||||||
name: "",
|
name: "",
|
||||||
|
company: "",
|
||||||
role: "",
|
role: "",
|
||||||
phone: "",
|
phone: "",
|
||||||
email: "",
|
email: "",
|
||||||
@@ -135,6 +136,7 @@ export default function Contacts() {
|
|||||||
setFormData({
|
setFormData({
|
||||||
groupId: effectiveGroupId ?? 0,
|
groupId: effectiveGroupId ?? 0,
|
||||||
name: "",
|
name: "",
|
||||||
|
company: "",
|
||||||
role: "",
|
role: "",
|
||||||
phone: "",
|
phone: "",
|
||||||
email: "",
|
email: "",
|
||||||
@@ -148,6 +150,7 @@ export default function Contacts() {
|
|||||||
setFormData({
|
setFormData({
|
||||||
groupId: contact.groupId,
|
groupId: contact.groupId,
|
||||||
name: contact.name,
|
name: contact.name,
|
||||||
|
company: (contact as any).company || "",
|
||||||
role: contact.role || "",
|
role: contact.role || "",
|
||||||
phone: contact.phone || "",
|
phone: contact.phone || "",
|
||||||
email: contact.email || "",
|
email: contact.email || "",
|
||||||
@@ -384,6 +387,9 @@ export default function Contacts() {
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p className="font-semibold text-gray-900">{contact.name}</p>
|
<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 && (
|
{contact.role && (
|
||||||
<p className="text-sm text-gray-500">{contact.role}</p>
|
<p className="text-sm text-gray-500">{contact.role}</p>
|
||||||
)}
|
)}
|
||||||
@@ -485,6 +491,16 @@ export default function Contacts() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</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>
|
<div>
|
||||||
<Label htmlFor="c-role">Fonction / Rôle</Label>
|
<Label htmlFor="c-role">Fonction / Rôle</Label>
|
||||||
<Input
|
<Input
|
||||||
|
|||||||
@@ -19,3 +19,6 @@ CREATE TABLE IF NOT EXISTS contacts (
|
|||||||
|
|
||||||
-- Index pour recherche rapide par magasin
|
-- Index pour recherche rapide par magasin
|
||||||
CREATE INDEX IF NOT EXISTS idx_contacts_group_id ON contacts(group_id);
|
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,
|
id,
|
||||||
groupId: contactData.groupId,
|
groupId: contactData.groupId,
|
||||||
name: contactData.name,
|
name: contactData.name,
|
||||||
|
company: contactData.company || null,
|
||||||
role: contactData.role || null,
|
role: contactData.role || null,
|
||||||
phone: contactData.phone || null,
|
phone: contactData.phone || null,
|
||||||
email: contactData.email || null,
|
email: contactData.email || null,
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ export const contacts = pgTable("contacts", {
|
|||||||
id: serial("id").primaryKey(),
|
id: serial("id").primaryKey(),
|
||||||
groupId: integer("group_id").notNull(),
|
groupId: integer("group_id").notNull(),
|
||||||
name: varchar("name").notNull(),
|
name: varchar("name").notNull(),
|
||||||
|
company: varchar("company"),
|
||||||
role: varchar("role"),
|
role: varchar("role"),
|
||||||
phone: varchar("phone"),
|
phone: varchar("phone"),
|
||||||
email: varchar("email"),
|
email: varchar("email"),
|
||||||
|
|||||||
Reference in new issue
Block a user