import { IGroupSharingOptions } from "./helpers" ; import { searchItems } from "../items/search" ; import { ISearchOptions } from "../util/search" ; param requestOptions returns export function isItemSharedWithGroup ( requestOptions ) { const searchOpts = { q : `id: ${ requestOptions . id } AND group: ${ requestOptions . groupId }` , start : 1 , num : 10 , sortField : "title" , authentication : requestOptions . authentication , httpMethod : "POST" } as ISearchOptions ; return searchItems ( searchOpts ) . then ( searchResponse => { let result = false ; if ( searchResponse . total > 0 ) { result = searchResponse . results . some ( ( itm ) => { return itm . id === requestOptions . id ; } ) ; return result ; } } ) ; }