deleteFile()

Syntax

deleteFile(file_id: string | number, token?: string)

Delete the file by id.

Parameters

Example

import { deleteFile } from "@eueno/lib-browser";
 
const handleDeleteFile = async () => {
   if (!token) return toast.error("Token null!");
   try {
     const id =220428”;
     const res = await deleteFile(id);
     if (res.status === 200) {
       console.log("Delete successfully");
     }
   } catch (error) {
     console.error(error);
   }
 };

Response of example:

{
    "msg": "success"
}

Last updated