Skip to content

Commit

Permalink
Fixing pnp#1294
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-rodgers committed Jul 27, 2020
1 parent 888f0b4 commit 41d7c35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/contributing/debug-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ describe("Items", () => {
- Each test should be self contained and not depend on other tests, they can depend on work done in before or beforeAll
- When writing tests you can use "only" and "skip" from mochajs to focus on only the tests you are writing
- Be sure to review the [various options](../npm-scripts.md#test) when running your tests
- If you are writing a test and the endpoint doesn't support app only permissions, you can skip writing a test - but please note that in the PR description
## Next Steps
Expand Down
10 changes: 7 additions & 3 deletions packages/sp/fields/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,11 +448,15 @@ export class _Field extends _SharePointQueryableInstance<IFieldInfo> {
* @param fieldType The type value such as SP.FieldLookup. Optional, looked up from the field if not provided
*/
@tag("f.update")
public async update(properties: Partial<IFieldInfo>, fieldType?: string): Promise<IFieldUpdateResult> {
public async update(properties: any, fieldType?: string): Promise<IFieldUpdateResult> {

if (typeof fieldType === "undefined" || fieldType === null) {
const info = await this.select("FieldTypeKind")();
fieldType = `SP.Field${FieldTypes[info.FieldTypeKind]}`;
const info = await Field(this).select("FieldTypeKind").configure({
headers: {
"Accept": "application/json",
},
})();
fieldType = info["odata.type"];
}

const req = body(assign(metadata(fieldType), properties), headers({ "X-HTTP-Method": "MERGE" }));
Expand Down

0 comments on commit 41d7c35

Please sign in to comment.