ContactsModalStructure.js 1.14 KB
import _ from 'lodash';

class ContactModals {

    AddContactRequest = (cntSin, modalName) => {
        let contactsStructure = JSON.parse(localStorage.getItem("ContactsModel"));
        
        if (contactsStructure.Contacts.length != 0)
        {
            _.remove(contactsStructure.Contacts, {
                ContactFormName : modalName
            } )        
        }

        contactsStructure.Contacts.push(cntSin);
        localStorage.setItem("ContactsModel", JSON.stringify(contactsStructure));

        /*contactsStructure = {
            "Contacts" : [
                ContactStructure = {
                    ContactFormName: "",
                    BusinessName: "",
                    Email: "",
                    PhoneNumber: "",
                    PrivacyAck: false,
                    AllowContact: false
                }                 
            ]
        }*/

        //localStorage.setItem("ContactsModel", JSON.stringify(response.data));  
    }

    GetContactByModalName = (modalName) => {
        
    }

    DeleteContactRequest = (cntSin) => {
        
    }
}

export {ContactModals}