@peable/services
Advanced tools
Comparing version 0.0.17 to 0.0.18
@@ -8,3 +8,3 @@ interface User { | ||
} | ||
declare const useGetUsersByIds: (ids: string[], fields: (keyof User)[]) => { | ||
declare const useGetUsersByIds: (ids: string[], fields?: (keyof User)[]) => { | ||
users: User[] | null; | ||
@@ -11,0 +11,0 @@ status: "loading" | "loaded" | "error" | "idle"; |
@@ -16,3 +16,5 @@ import { useState, useEffect } from "react"; | ||
const user = response.data; | ||
return fields.reduce((obj, key) => ({ ...obj, [key]: user[key] }), {}); | ||
return fields | ||
? fields.reduce((obj, key) => ({ ...obj, [key]: user[key] }), {}) | ||
: user; | ||
}); | ||
@@ -19,0 +21,0 @@ setUsers(users); |
{ | ||
"name": "@peable/services", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5898
114