mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-09 13:06:14 +00:00
add endpoint GET /attributedefinitions/{id}
This commit is contained in:
parent
35d7d132d3
commit
8c589a60ba
|
@ -2823,6 +2823,22 @@ final class SeedDMS_RestapiController { /* {{{ */
|
||||||
return $this->renderer->json($response, array('success'=>true, 'message'=>'', 'data'=>$data))->withStatus(200);
|
return $this->renderer->json($response, array('success'=>true, 'message'=>'', 'data'=>$data))->withStatus(200);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
function getAttributeDefinition($request, $response, $args) { /* {{{ */
|
||||||
|
$dms = $this->container->get('dms');
|
||||||
|
$userobj = $this->container->get('userobj');
|
||||||
|
|
||||||
|
if (!ctype_digit($args['id'])) {
|
||||||
|
return $this->renderer->json($response, array('success'=>false, 'message'=>'Invalid parameter', 'data'=>''))->withStatus(400);
|
||||||
|
}
|
||||||
|
|
||||||
|
$attrdef = $dms->getAttributeDefinition($args['id']);
|
||||||
|
if ($attrdef) {
|
||||||
|
return $this->renderer->json($response, array('success'=>true, 'message'=>'', 'data'=>$this->__getAttributeDefinitionData($attrdef)))->withStatus(200);
|
||||||
|
} else {
|
||||||
|
return $this->renderer->json($response, array('success'=>false, 'message'=>'No such attributedefinition', 'data'=>''))->withStatus(404);
|
||||||
|
}
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the name of an existing attribute definition
|
* Updates the name of an existing attribute definition
|
||||||
*
|
*
|
||||||
|
@ -3257,6 +3273,7 @@ $app->delete('/categories/{id}', \SeedDMS_RestapiController::class.':deleteCateg
|
||||||
$app->post('/categories', \SeedDMS_RestapiController::class.':createCategory');
|
$app->post('/categories', \SeedDMS_RestapiController::class.':createCategory');
|
||||||
$app->put('/categories/{id}/name', \SeedDMS_RestapiController::class.':changeCategoryName');
|
$app->put('/categories/{id}/name', \SeedDMS_RestapiController::class.':changeCategoryName');
|
||||||
$app->get('/attributedefinitions', \SeedDMS_RestapiController::class.':getAttributeDefinitions');
|
$app->get('/attributedefinitions', \SeedDMS_RestapiController::class.':getAttributeDefinitions');
|
||||||
|
$app->get('/attributedefinitions/{id}', \SeedDMS_RestapiController::class.':getAttributeDefinition');
|
||||||
$app->put('/attributedefinitions/{id}/name', \SeedDMS_RestapiController::class.':changeAttributeDefinitionName');
|
$app->put('/attributedefinitions/{id}/name', \SeedDMS_RestapiController::class.':changeAttributeDefinitionName');
|
||||||
$app->get('/echo/{data}', \SeedDMS_TestController::class.':echoData');
|
$app->get('/echo/{data}', \SeedDMS_TestController::class.':echoData');
|
||||||
$app->get('/version', \SeedDMS_TestController::class.':version');
|
$app->get('/version', \SeedDMS_TestController::class.':version');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user