deleteFolder()

Syntax

deleteFolder(projectId: string, folderPath: string, token?: string)

Delete a folder in the project.

Parameters

NameTypeRequiredDescription

projectId

string

Yes

The project ID.

folderPath

string

Yes

The path to access the folder that you want to delete. For example, if you want to delete the folder “Profile" in “NewFolder", the path will be like this: "NewFolder/Profile".

token

string

No

The authentication token response from Eueno API when login. After login, this token was saved in local storage with the name “eueno-token".

Example

import { deleteFolder } from "@eueno/lib-browser";
 
const onDelete = async () => {
   if (!token) return toast.error("Token null!");
   try {
         const projectId = "112";
         const path = "NewFolder/Profile";
         const res = await deleteFolder(projectId, path);
       
     if (res.status === 200) {
       console.log("Delete successfully");
     }
   } catch (error) {
     console.error(error);
   }
 };

Response of example:

{"msg":"success"}

Last updated