Filed not updating in database

I have a form and i need to update email address when user edits it. The old eaiml should get deleted and new one should get saved. but its not working

Welcome to the forum. You will find this is a great place to ask questions and post your code using the forums per-formatted text button.

Sorry to hear about your form not working.

hi, can you help me with it?

With what? You didn’t post anything.


static get_deal_building_info(deal_id, building_id){
        return new Promise(resolve => {
            let data = {
            let data_obj = {
                url : `/api/dealboard/deals/${deal_id}/buildings/${building_id}`,
            this.observable_handler = new generic_handler();
            let cur_req = this.observable_handler.observable_post(data_obj);
                    next: (res)=>{
                    error: e => comparison_data.show_error(),
                    complete: () => {



  $this->altoRouter->map('POST', '/api/dealboard/deals/[i:deal_id]/buildings/[i:building_id]', function($deal_id, $building_id){
            header("Access-Control-Allow-Orgin: *");
            header("Access-Control-Allow-Methods: *");
            header("Content-Type: application/json");
            header("HTTP/1.1 200 OK");
            $data = json_decode(file_get_contents('php://input'));
            $success = false;
            $decoded_response['message'] = "";
            $manage_sharing_permissions = new manage_sharing_permissions();
            try {
                $building_id = $data->building_id;
                    $check_deal_id = get_deal_id_from_building_id($building_id);
                    $deal = new deal($check_deal_id);
                    $client_id = $deal->data['client_id'];
                    $client = new client($client_id);
                    $contact=new contact($client->data['primary_contact_id']);
                    $client->data['first_name'] = $contact->data['first_name'];
                    $client->data['email'] = $contact->data['email'];

                    $building = new building($building_id);
                    $deal_contact = new deal_contact();
                    $landlord_info = $deal_contact->get_mandatory_deal_contact($building_id,'company_contact');
                    $building->data['first_name'] = $landlord_info['first_name'];
                    $building->data['email'] = $landlord_info['email'];
                    $deal_data = $deal->data;
                    $client_data = $client->data;
                    $building_data = $building->data;

                    $decoded_response['deal_data'] = $deal_data;
                    $decoded_response['client_data'] = $client_data;
                    $decoded_response['building_data'] = $building_data;

                    $success = true;


  function get_mandatory_deal_contact($deal_id,$request_type='company_contact'){
        $this->name = "deal_contact";
        $this->find("deal_id = '$deal_id' AND contact_type = '$request_type' AND is_mandatory = 1","","contact_level asc");
        return $this->data;

this is the part of the code for updating email address when user edits it. When i try to manually update the filed value in db, its getting updates and is reflected in the page. But not through the code

I see nothing that updates anything?

Sponsor our Newsletter | Privacy Policy | Terms of Service