💄 front: trim names and prevent spaces only (#656)
This commit is contained in:
@@ -23,7 +23,7 @@ export const CreateFolder = () => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const createFolderHandler = async () => {
|
const createFolderHandler = async () => {
|
||||||
await create({ name, parent_id: state.parent_id, is_directory: true }, {});
|
await create({ name: (name || '').trim(), parent_id: state.parent_id, is_directory: true }, {});
|
||||||
setState({ ...state, open: false });
|
setState({ ...state, open: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ export const CreateFolder = () => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
disabled={!name}
|
disabled={!(name || '').trim()}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
className="mt-4 float-right"
|
className="mt-4 float-right"
|
||||||
onClick={createFolderHandler}
|
onClick={createFolderHandler}
|
||||||
|
|||||||
Reference in New Issue
Block a user