diff --git a/api.php b/api.php index 46f534e..9cecb47 100644 --- a/api.php +++ b/api.php @@ -1072,7 +1072,7 @@ switch($request[0]) { switch($request[2]){ /* APIDOC: project/mentor/edit post(mentors array of mentor arrays) - object(mentor: {id,registrations_id,firstname,lastname,email,phone,organization,position,description}) + object(mentor: {id,firstname,lastname,email,phone,organization,position,description}) object(mentors: {mentor,...}) description(edit a list of project mentors or add new ones if a mentor array has no id) return(mentors array of mentor arrays) diff --git a/register_participants.inc.php b/register_participants.inc.php index 16e7fdd..7b3fad5 100644 --- a/register_participants.inc.php +++ b/register_participants.inc.php @@ -609,7 +609,7 @@ function userCanEditMentor($userId, $mentorId){ // return a list of fields that should be included in the mentor array function getMentorFields(){ return array( - 'id', 'registrations_id', + 'id', 'firstname', 'lastname', 'email', 'phone', 'organization', 'position', @@ -643,6 +643,7 @@ function saveMentorData($data){ $queryParts = array(); foreach($fields as $key){ if($key == 'id') continue; + if($key == 'registrations_id') continue; $queryParts[] = "`$key` = '{$data[$key]}' "; } $query .= implode(',', $queryParts);