deleteProject()

Syntax

deleteProject(projectId: string, token?: string)

Delete the project by project ID.

Parameters

NameTypeRequiredDescription

projectId

string

Yes

The project ID.

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".

Returns

Promise returns an object with two properties is:

  • “folders” - [ ]: array of folders name

  • “files” - [ ]: array of objects, each object includes file information

Example

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

const onDelete = async () => {
   if (!token || !projectId) return;
   try {
     const res = await deleteProject(projectId);
     if (res?.status === 200) {
       console.log("Delete successfully");
     }
   } catch (error) {
     console.error(error);
   }
};

Response of example:

{
    "msg": "success"
}

Last updated