11import { Queryable , QueryableInstance , QueryableCollection } from "./queryable" ;
2- import { SiteUser , SiteUsers } from "./siteusers" ;
2+ import { SiteUsers } from "./siteusers" ;
33import { Util } from "../utils/util" ;
4-
5- /**
6- * Properties that provide a getter, but no setter.
7- *
8- */
9- export interface GroupReadOnlyProperties {
10- canCurrentUserEditMembership ?: boolean ;
11- canCurrentUserManageGroup ?: boolean ;
12- canCurrentUserViewMembership ?: boolean ;
13- id ?: number ;
14- isHiddenInUI ?: boolean ;
15- loginName ?: string ;
16- ownerTitle ?: string ;
17- principalType ?: PrincipalType ;
18- users ?: SiteUsers ;
19- }
20-
21- /**
22- * Properties that provide both a getter, and a setter.
23- *
24- */
25- export interface GroupWriteableProperties {
26- allowMembersEditMembership ?: boolean ;
27- allowRequestToJoinLeave ?: boolean ;
28- autoAcceptRequestToJoinLeave ?: boolean ;
29- description ?: string ;
30- onlyAllowMembersViewMembership ?: boolean ;
31- owner ?: number | SiteUser | SiteGroup ;
32- requestToJoinLeaveEmailSetting ?: string ;
33- title ?: string ;
34- }
35-
36- /**
37- * Group Properties
38- *
39- */
40- export interface GroupProperties extends GroupReadOnlyProperties , GroupWriteableProperties {
41- __metadata : { id ?: string , url ?: string , type ?: string } ;
42- }
4+ import { TypedHash } from "../collections/collections" ;
435
446/**
457 * Principal Type enum
@@ -93,7 +55,7 @@ export class SiteGroups extends QueryableCollection {
9355 *
9456 * @param props The properties to be updated
9557 */
96- public add ( properties : GroupWriteableProperties ) : Promise < GroupAddResult > {
58+ public add ( properties : TypedHash < any > ) : Promise < GroupAddResult > {
9759 let postBody = JSON . stringify ( Util . extend (
9860 { "__metadata" : { "type" : "SP.Group" } } , properties ) ) ;
9961
@@ -175,7 +137,7 @@ export class SiteGroup extends QueryableInstance {
175137 * @param properties A GroupWriteableProperties object of property names and values to update for the user
176138 */
177139 /* tslint:disable no-string-literal */
178- public update ( properties : GroupWriteableProperties ) : Promise < GroupUpdateResult > {
140+ public update ( properties : TypedHash < any > ) : Promise < GroupUpdateResult > {
179141
180142 let postBody = Util . extend ( { "__metadata" : { "type" : "SP.Group" } } , properties ) ;
181143
@@ -188,8 +150,8 @@ export class SiteGroup extends QueryableInstance {
188150
189151 let retGroup : SiteGroup = this ;
190152
191- if ( properties . hasOwnProperty ( "title " ) ) {
192- retGroup = this . getParent ( SiteGroup , this . parentUrl , `getByName('${ properties . title } ')` ) ;
153+ if ( properties . hasOwnProperty ( "Title " ) ) {
154+ retGroup = this . getParent ( SiteGroup , this . parentUrl , `getByName('${ properties [ "Title" ] } ')` ) ;
193155 }
194156
195157 return {
@@ -203,5 +165,5 @@ export class SiteGroup extends QueryableInstance {
203165
204166export interface SiteGroupAddResult {
205167 group : SiteGroup ;
206- data : GroupProperties ;
168+ data : any ;
207169}
0 commit comments