Skip to content

Commit

Permalink
added extendFieldInfos
Browse files Browse the repository at this point in the history
  • Loading branch information
shaipetel committed Nov 22, 2024
1 parent 1164a19 commit 8035c1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/helpers/sharepoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ export function extendFieldInfo(field: IFieldInfo, allFields?: IFieldInfo[]): IF
return fieldEx;
}

export function extendFieldInfos(fields: IFieldInfo[]) {
return fields.map(f => extendFieldInfo(f, fields));
}

export function getFieldOutputType(field: IFieldInfo) {
let outputType = field.TypeAsString;

Expand Down
4 changes: 2 additions & 2 deletions src/utils/sharepoint.rest/list.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PushNoDuplicate, firstOrNull, makeUniqueArray, toHash } from "../../helpers/collections.base";
import { jsonStringify } from "../../helpers/json";
import { NormalizeListName, SPBasePermissions, SchemaXmlToJson, extendFieldInfo } from "../../helpers/sharepoint";
import { NormalizeListName, SPBasePermissions, SchemaXmlToJson, extendFieldInfos } from "../../helpers/sharepoint";
import { normalizeGuid } from "../../helpers/strings";
import { SafeIfElse, isBoolean, isNotEmptyArray, isNullOrEmptyArray, isNullOrEmptyString, isNullOrUndefined, isNumber, isPromise, isString, isValidGuid } from "../../helpers/typecheckers";
import { makeServerRelativeUrl, normalizeUrl } from "../../helpers/url";
Expand Down Expand Up @@ -287,7 +287,7 @@ function _processGetListFields(fields: IFieldInfo[], fieldNames: string[]) {
if (isNullOrEmptyArray(fields)) {
return fields as IFieldInfoEX[];
}
let extendedFields = fields.map(f => extendFieldInfo(f, fields));
let extendedFields = extendFieldInfos(fields);

if (!isNullOrEmptyArray(fieldNames)) {
return extendedFields.filter((extendedField) => {
Expand Down

0 comments on commit 8035c1f

Please sign in to comment.