monicahq / monica

Personal CRM. Remember everything about your friends, family and business relationships.
https://beta.monicahq.com
GNU Affero General Public License v3.0
21.79k stars 2.19k forks source link

fix: allow deletion of contact information types without refreshing page #7377

Closed Otanga-Otieno closed 1 month ago

Otanga-Otieno commented 3 months ago

Close #7214

The object returned by Model::create doesn't include database columns that are filled by default and not passed to the create function. This causes the 'can_be_deleted' property in our ContactInformationType object to always be null after the record has been created. Calling the refresh function on the instance re-retrieves its data from the db, fixing the issue

CLAassistant commented 3 months ago

CLA assistant check
All committers have signed the CLA.