File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 99
1010use DateTime ;
1111use Exception ;
12+ use OCA \Tables \Constants \ColumnType ;
1213use OCA \Tables \Db \Column ;
1314use OCA \Tables \Db \ColumnMapper ;
1415use OCA \Tables \Db \Table ;
1516use OCA \Tables \Db \TableMapper ;
1617use OCA \Tables \Db \View ;
1718use OCA \Tables \Dto \Column as ColumnDto ;
19+ use OCA \Tables \Errors \BadRequestError ;
1820use OCA \Tables \Errors \InternalError ;
1921use OCA \Tables \Errors \NotFoundError ;
2022use OCA \Tables \Errors \PermissionError ;
@@ -194,6 +196,9 @@ public function create(
194196 ColumnDto $ columnDto ,
195197 array $ selectedViewIds = [],
196198 ):Column {
199+ if (ColumnType::tryFrom ($ columnDto ->getType ()) === null ) {
200+ throw new BadRequestError ('Column type ' . $ columnDto ->getType () . ' does not exist. ' );
201+ }
197202 // security
198203 if ($ viewId ) {
199204 try {
You can’t perform that action at this time.
0 commit comments