import 'rxjs/add/operator/pluck' ; import { ProjectId } from 'teambition-types' ; import { Observable } from 'rxjs/Observable' ; import { QueryToken } from '../../db' ; import { SDKFetch } from '../../SDKFetch' ; import { SDK , CacheStrategy } from '../../SDK' ; import { AssignmentLinkSchema } from '../../schemas/AssignmentLink' ; export function getAssignmentLinksFetch ( this , projectId ) { return this . get ( `projects/${ projectId }/assignment-links` ) . pluck ( 'result' ) ; } SDKFetch . prototype . getAssignmentLinks = getAssignmentLinksFetch ; declare module '../../SDKFetch' { interface SDKFetch { getAssignmentLinks : typeof getAssignmentLinksFetch ; } } export function getAssignmentLinks ( this , projectId ) { return this . lift < AssignmentLinkSchema > ( { cacheValidate : CacheStrategy . Request , tableName : 'AssignmentLink' , request : this . fetch . getAssignmentLinks ( projectId ) , query : { where : { _projectId : projectId } } } ) ; } SDK . prototype . getAssignmentLinks = getAssignmentLinks ; declare module '../../SDK' { interface SDK { getAssignmentLinks : typeof getAssignmentLinks ; } }