adding 'GET /projects' endpoint

This commit is contained in:
erik
2013-12-05 23:01:02 -04:00
parent 8bbaa579c5
commit a9746497bc
2 changed files with 53 additions and 20 deletions

View File

@@ -15,6 +15,16 @@ use ProcessMaker\Adapter\Bpmn\Model as BpmnModel;
*/
class Project extends Api
{
function index()
{
try {
$projects = BpmnModel::loadProjects();
return $projects;
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
function post($request_data)
{
@@ -37,4 +47,4 @@ class Project extends Api
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
}
}