diff --git a/core/models/contacts.go b/core/models/contacts.go index 8c543afcd..22ca0d506 100644 --- a/core/models/contacts.go +++ b/core/models/contacts.go @@ -1353,15 +1353,6 @@ func GetContactLocker(orgID OrgID, contactID ContactID) *redisx.Locker { return redisx.NewLocker(key, time.Minute*5) } -// UpdateContactModifiedBy updates modified by the passed user id on the passed in contacts -func UpdateContactModifiedBy(ctx context.Context, db Queryer, contactIDs []ContactID, userID UserID) error { - if userID == NilUserID || len(contactIDs) == 0 { - return nil - } - _, err := db.ExecContext(ctx, `UPDATE contacts_contact SET modified_on = NOW(), modified_by_id = $2 WHERE id = ANY($1)`, pq.Array(contactIDs), userID) - return err -} - // ContactStatusChange struct used for our contact status change type ContactStatusChange struct { ContactID ContactID diff --git a/core/models/contacts_test.go b/core/models/contacts_test.go index 8a34a0aca..d9b93b6bb 100644 --- a/core/models/contacts_test.go +++ b/core/models/contacts_test.go @@ -509,27 +509,6 @@ func TestUpdateContactLastSeenAndModifiedOn(t *testing.T) { assert.True(t, cathy.ModifiedOn().After(t2)) } -func TestUpdateContactModifiedBy(t *testing.T) { - ctx, _, db, _ := testsuite.Get() - - defer testsuite.Reset(testsuite.ResetAll) - - err := models.UpdateContactModifiedBy(ctx, db, []models.ContactID{}, models.UserID(0)) - assert.NoError(t, err) - - assertdb.Query(t, db, `SELECT count(*) FROM contacts_contact WHERE id = $1 AND modified_by_id = NULL`, testdata.Cathy.ID).Returns(0) - - err = models.UpdateContactModifiedBy(ctx, db, []models.ContactID{testdata.Cathy.ID}, models.UserID(0)) - assert.NoError(t, err) - - assertdb.Query(t, db, `SELECT count(*) FROM contacts_contact WHERE id = $1 AND modified_by_id = NULL`, testdata.Cathy.ID).Returns(0) - - err = models.UpdateContactModifiedBy(ctx, db, []models.ContactID{testdata.Cathy.ID}, models.UserID(1)) - assert.NoError(t, err) - - assertdb.Query(t, db, `SELECT count(*) FROM contacts_contact WHERE id = $1 AND modified_by_id = 1`, testdata.Cathy.ID).Returns(1) -} - func TestUpdateContactStatus(t *testing.T) { ctx, _, db, _ := testsuite.Get()