Auto-commit 2026-04-27 19:13
This commit is contained in:
@@ -123,11 +123,20 @@ func contactEditCmd() *cobra.Command {
|
||||
address, _ := cmd.Flags().GetString("address")
|
||||
notes, _ := cmd.Flags().GetString("notes")
|
||||
|
||||
req := contact.UpdateContactRequest{
|
||||
Name: &name,
|
||||
Phone: &phone,
|
||||
Address: &address,
|
||||
Notes: ¬es,
|
||||
req := contact.UpdateContactRequest{}
|
||||
|
||||
// Only set pointer fields when the flag was explicitly changed
|
||||
if cmd.Flags().Changed("name") {
|
||||
req.Name = &name
|
||||
}
|
||||
if cmd.Flags().Changed("phone") {
|
||||
req.Phone = &phone
|
||||
}
|
||||
if cmd.Flags().Changed("address") {
|
||||
req.Address = &address
|
||||
}
|
||||
if cmd.Flags().Changed("notes") {
|
||||
req.Notes = ¬es
|
||||
}
|
||||
|
||||
updated, err := manager.Update(id, req)
|
||||
|
||||
Reference in New Issue
Block a user