Skip to content
This repository was archived by the owner on Nov 29, 2021. It is now read-only.

Commit f755e3f

Browse files
Guillaume NicolasNigui
authored andcommitted
feat: add parameter to not filter properties
1 parent 0332040 commit f755e3f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/clients/repositories/unik/functions.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ import { get, post } from "../network-repository";
66
export const unikGet = (client: HTTPClient) => (id: string): Promise<ResponseWithChainMeta<Unik>> =>
77
get<ResponseWithChainMeta<Unik>>(client)(`uniks/${id}`);
88

9-
export const unikProperties = (client: HTTPClient) => (id: string): Promise<ResponseWithChainMeta<UnikProperties>> =>
9+
export const unikProperties = (client: HTTPClient) => (
10+
id: string,
11+
onlyActiveBadge: boolean = true,
12+
): Promise<ResponseWithChainMeta<UnikProperties>> =>
1013
get<ResponseWithChainMeta<UnikProperties>>(client)(`uniks/${id}/properties`).then(response => {
11-
response.data = response.data?.filter(isActiveProperty);
14+
if (onlyActiveBadge) {
15+
response.data = response.data?.filter(isActiveProperty);
16+
}
1217
return response;
1318
});
1419

0 commit comments

Comments
 (0)