import { Observable } from 'rxjs/Observable' ; import { SDK } from '../../SDK' ; import { SDKFetch } from '../../SDKFetch' ; import { ProjectId , AssignmentLinkId } from 'teambition-types' ; import { AssignmentLinkSchema } from '../../schemas/AssignmentLink' ; type AssignmentLink = Partial < Pick < AssignmentLinkSchema , 'name' | '_assignedProjectId' | '_executorId' | 'assignmentType' > > ; export function updateAssignmentLinkFetch ( this , projectId , linkId , assignmentLink ) { return this . put ( `projects/${ projectId }/assignment-links/${ linkId }` , assignmentLink ) ; } SDKFetch . prototype . updateAssignmentLink = updateAssignmentLinkFetch ; declare module '../../SDKFetch' { interface SDKFetch { updateAssignmentLink : typeof updateAssignmentLinkFetch ; } } export function updateAssignmentLink ( this , projectId , linkId , assignmentLink ) { return this . lift ( { request : this . fetch . updateAssignmentLink ( projectId , linkId , assignmentLink ) , tableName : 'AssignmentLink' , method : 'update' , clause : { _id : linkId } } ) ; } SDK . prototype . updateAssignmentLink = updateAssignmentLink ; declare module '../../SDK' { export interface SDK { updateAssignmentLink : typeof updateAssignmentLink ; } }