mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Default to schema response part in LeftAndMain->schema()
More of a standard API approach to return data by default, and make customisation via HTTP headers an optional mode.
This commit is contained in:
parent
adbcddee80
commit
c3a8159e80
@ -231,13 +231,8 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
|||||||
$validHeaderValues = ['schema', 'state'];
|
$validHeaderValues = ['schema', 'state'];
|
||||||
return in_array(trim($value), $validHeaderValues);
|
return in_array(trim($value), $validHeaderValues);
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
|
$schemaParts = ['schema'];
|
||||||
if (!count($schemaParts)) {
|
|
||||||
throw new SS_HTTPResponse_Exception(
|
|
||||||
'Invalid request. Check you\'ve set a "X-Formschema-Request" header with "schema" or "state" values.',
|
|
||||||
400
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$return = ['id' => $form->getName()];
|
$return = ['id' => $form->getName()];
|
||||||
|
Loading…
Reference in New Issue
Block a user