FIX: Wrong type in category_id param input (#304)
* FIX: Wrong type in category_id param input We will dasherize category_id. The dasherize function accepts a string, but we don't type-check it, so the default null may be passed in. This will cause a type error and crash the front-end.
This commit is contained in:
@@ -164,6 +164,7 @@ export default class ParamInput extends Component {
|
||||
}
|
||||
|
||||
dasherizeCategoryId(value) {
|
||||
value = String(value || "");
|
||||
const isPositiveInt = /^\d+$/.test(value);
|
||||
if (!isPositiveInt && value !== dasherize(value)) {
|
||||
return dasherize(value);
|
||||
|
||||
Reference in New Issue
Block a user