forked from science-ation/science-ation
modified the project/add API to not expect any data, but simply create the project.
This commit is contained in:
parent
3745d8cfd9
commit
ef4a14a386
15
api.php
15
api.php
@ -870,7 +870,6 @@ switch($request[0]) {
|
||||
switch($request[1]){
|
||||
/* APIDOC: project/add
|
||||
description(add a project)
|
||||
post(projectdivisions_id integer, title varchar(255), language char(2), req_electricity enum('no', 'yes'), req_table enum('no', 'yes'), req_special varchar(128), summary text)
|
||||
return(project array)
|
||||
*/
|
||||
case 'add':
|
||||
@ -898,6 +897,13 @@ switch($request[0]) {
|
||||
break;
|
||||
}
|
||||
|
||||
// if we got this far, then all's good and we can return the project data
|
||||
$ret['status'] = 'ok';
|
||||
$ret['project'] = getProject($regNumber);
|
||||
break;
|
||||
// remarking this code for now as it may get used very shortly for a project update
|
||||
// functionality. Was previously in the "add" post
|
||||
/*
|
||||
// and then save the posted data to that project
|
||||
$params['project_id'] = $project['id'];
|
||||
foreach($_POST as $fieldName){
|
||||
@ -909,12 +915,9 @@ switch($request[0]) {
|
||||
$ret['error'] = $message;
|
||||
break;
|
||||
}
|
||||
|
||||
// if we got thes far, then all's good and we can return the project data
|
||||
$ret['status'] = 'ok';
|
||||
$ret['project'] = getProject($regNumber);
|
||||
|
||||
break;
|
||||
*/
|
||||
|
||||
|
||||
/* APIDOC: project/edit
|
||||
post(project_id integer, projectdivisions_id integer, title varchar(255), language char(2), req_electricity enum('no', 'yes'), req_table enum('no', 'yes'), req_special varchar(128), summary text)
|
||||
|
@ -593,7 +593,7 @@ function saveProjectData($data){
|
||||
|
||||
//get a random registration number between 100000 and 999999 (six digit integer)
|
||||
// that isn't already in use
|
||||
//TODO - set up a method or ensuring that the very unlikely chance of two people simultaneously
|
||||
//TODO - set up a method of ensuring that the very unlikely chance of two people simultaneously
|
||||
// getting the same number is in fact impossible
|
||||
function getNewRegNum(){
|
||||
global $conference;
|
||||
|
Loading…
Reference in New Issue
Block a user