feat: implement getFieldsByIds method

This commit is contained in:
StevanFreeborn
2023-02-03 11:17:53 -06:00
parent bd55381dc9
commit 22ba4520ef
5 changed files with 271 additions and 4 deletions
+2 -1
View File
@@ -129,7 +129,8 @@ export class OnspringClient {
fieldIds: number[]
): Promise<ApiResponse<CollectionResponse<Field>>> {
const endpoint = EndpointFactory.getFieldsByIdsEndpoint();
const apiResponse = await this.post<any>(endpoint, fieldIds);
const uniqueIds = [...new Set(fieldIds)];
const apiResponse = await this.post<any>(endpoint, uniqueIds);
if (apiResponse.isSuccessful === false) {
return apiResponse;