@vivlab/api-database
Advanced tools
Comparing version 1.0.36 to 1.0.37
@@ -11,3 +11,3 @@ export interface AlgoliaOptions { | ||
} | ||
export declare function count({ indice, activeOnly }: AlgoliaOptions & { | ||
export declare function count({ indice, activeOnly, stripeAccount }: AlgoliaOptions & { | ||
activeOnly: boolean; | ||
@@ -14,0 +14,0 @@ }): Promise<{ |
@@ -12,7 +12,7 @@ "use strict"; | ||
const PREFIX = process.env.NODE_ENV === "production" ? "prod" : "dev"; | ||
async function count({ indice, activeOnly }) { | ||
async function count({ indice, activeOnly, stripeAccount }) { | ||
const index = client.initIndex(indice); | ||
const result = await index.search("", { | ||
hitsPerPage: 0, | ||
filters: activeOnly ? "active:true" : undefined | ||
filters: activeOnly ? `_account:${stripeAccount} AND active:true` : undefined | ||
}); | ||
@@ -19,0 +19,0 @@ return { count: result.nbHits }; |
{ | ||
"name": "@vivlab/api-database", | ||
"version": "1.0.36", | ||
"version": "1.0.37", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
371173