forked from science-ation/science-ation
Remove registrations_id from the mentor object, it gets set when a mentor is added automatically, but should never be changed
This commit is contained in:
parent
693fb1e398
commit
6f882b38b9
2
api.php
2
api.php
@ -1072,7 +1072,7 @@ switch($request[0]) {
|
|||||||
switch($request[2]){
|
switch($request[2]){
|
||||||
/* APIDOC: project/mentor/edit
|
/* APIDOC: project/mentor/edit
|
||||||
post(mentors array of mentor arrays)
|
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,...})
|
object(mentors: {mentor,...})
|
||||||
description(edit a list of project mentors or add new ones if a mentor array has no id)
|
description(edit a list of project mentors or add new ones if a mentor array has no id)
|
||||||
return(mentors array of mentor arrays)
|
return(mentors array of mentor arrays)
|
||||||
|
@ -609,7 +609,7 @@ function userCanEditMentor($userId, $mentorId){
|
|||||||
// return a list of fields that should be included in the mentor array
|
// return a list of fields that should be included in the mentor array
|
||||||
function getMentorFields(){
|
function getMentorFields(){
|
||||||
return array(
|
return array(
|
||||||
'id', 'registrations_id',
|
'id',
|
||||||
'firstname', 'lastname',
|
'firstname', 'lastname',
|
||||||
'email', 'phone',
|
'email', 'phone',
|
||||||
'organization', 'position',
|
'organization', 'position',
|
||||||
@ -643,6 +643,7 @@ function saveMentorData($data){
|
|||||||
$queryParts = array();
|
$queryParts = array();
|
||||||
foreach($fields as $key){
|
foreach($fields as $key){
|
||||||
if($key == 'id') continue;
|
if($key == 'id') continue;
|
||||||
|
if($key == 'registrations_id') continue;
|
||||||
$queryParts[] = "`$key` = '{$data[$key]}' ";
|
$queryParts[] = "`$key` = '{$data[$key]}' ";
|
||||||
}
|
}
|
||||||
$query .= implode(',', $queryParts);
|
$query .= implode(',', $queryParts);
|
||||||
|
Loading…
Reference in New Issue
Block a user