createFolder()

Syntax

createFolder(folderName: string, token: string, currentPathArray: string[])

Create new folder in a project or a parent folder.

Parameters

Example

import { createFolder } from "@eueno/lib-browser"; 

let folderName = "NewFolder";
let currentPathArray = ["112", "ParentFolder"]; // 112 is projectId

const onSubmit = async () => {
   try {
     const response = await createFolder(folderName, token, currentPathArray);
     if (response?.status == 200) {
       console.log("Folder created");
     }
   } catch (error) {
     console.error(error);
   }
 };

Response of example:

{
     "name": "NewFolder",
     "path": "ParentFolder/NewFolder"
}

Last updated