Function genericListFetch

  • Parameters

    • model: any

      The prisma model to make use of

    • data: any

      The data to be used for fetching list e.g { page: string, limit: string, search: string }

    • keyQuery: { [key: string]: any }

      The query to be used for fetching list e.g { id: string, name: string }

    • permissions: IPermission

      The permissions to be used for fetching, reference IPermission interface

    • misc: { include?: any; orderBy?: any; select?: any } = {}

      These are the prisma options e.g { include: string, select: string, orderBy: string }

    Returns Promise<{ data: any; page: any; total: any; totalPages: number }>

    The list of data