mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
updated saveFolder function, to validate newFolderName state before creating folder (#1125)
This commit is contained in:
parent
6b79e26360
commit
5ffcc14d68
1 changed files with 7 additions and 0 deletions
|
|
@ -22,6 +22,13 @@ export const Folders = function Folders({
|
|||
const [activeFolder, setActiveFolder] = useState(currentFolder || {});
|
||||
|
||||
function saveFolder() {
|
||||
if(!newFolderName || !newFolderName.trim()) {
|
||||
toast.warn('folder name can\'t be empty.', {
|
||||
hideProgressBar: true,
|
||||
position: 'top-left',
|
||||
});
|
||||
return;
|
||||
}
|
||||
setCreationStatus(true);
|
||||
folderService.create(newFolderName).then(() => {
|
||||
toast.info('folder created.', {
|
||||
|
|
|
|||
Loading…
Reference in a new issue