Skip to content

Commit

Permalink
fix: failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
moltar authored and nguyentoanit committed Nov 6, 2019
1 parent 00dca8e commit 00f828d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/operations/profiles/ops-profiles.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import { Operation } from '../operation'
import { Profile, ProfileId, ProfileResponse } from './types'
import { Decode, DecodeArray } from '../../decorators'

export class ProfileOperation extends Operation {
protected resource = 'profiles'

@DecodeArray(Profile)
public listProfiles = (): Promise<Profile[]> =>
this.client.get<Profile[]>(`${this.version}/${this.resource}`)
public listProfiles() {
return this.client.get<Profile[]>(`${this.version}/${this.resource}`)
}

@Decode(Profile)
public getProfile = (profileId: ProfileId): Promise<Profile> =>
this.client.get<Profile>(`${this.version}/${this.resource}/${profileId}`)
public getProfile(profileId: ProfileId) {
return this.client.get<Profile>(`${this.version}/${this.resource}/${profileId}`)
}

@DecodeArray(ProfileResponse)
public updateProfiles = (profiles: Partial<Profile>[]): Promise<ProfileResponse[]> =>
this.client.put<ProfileResponse[]>(`${this.version}/${this.resource}`, profiles)
public updateProfiles(profiles: Partial<Profile>[]) {
return this.client.put<ProfileResponse[]>(`${this.version}/${this.resource}`, profiles)
}
}

0 comments on commit 00f828d

Please sign in to comment.