getProjects()

Syntax

get projects: (
  page?: number,
  pageSize?: number,
  sortBy?: string,
  token?: string
)

This method is used to get all projects of user.

Parameters

Example

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

const getList = async () => {
   try {
     const page = 1;
     const PAGE_SIZE = 10;
     
     const response = await getProjects(page, PAGE_SIZE);
     if (response?.data?.data) {
       console.log(response.data);
     }
   } catch (error) {
     console.error(error);
   }
 };

Response of example:

{
    "msg": "success",
    "data": [
        {
            "id": 102,
            "name": "Oraichain US",
            "ownerAddress": "0x8bf5bf899059cde0e9770f4740fa9c8f6f5d07f9",
            "totalFile": "3",
            "totalSize": "0",
            "createdAt": "2023-03-02T06:48:23.968Z",
            "updatedAt": "2023-03-20T05:10:05.853Z"
        },
        {
            "id": 96,
            "name": "Kawaiiverse",
            "ownerAddress": "0x8bf5bf899059cde0e9770f4740fa9c8f6f5d07f9",
            "totalFile": "6",
            "totalSize": "7309338",
            "createdAt": "2023-02-28T04:47:28.802Z",
            "updatedAt": "2023-03-20T05:10:05.836Z"
        }
    ],
    "options": {
        "totalItems": 2
    }
}

Last updated