Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #55 from longguikeji/yh/optimization
Browse files Browse the repository at this point in the history
refactor(user): adapt to tweaked user api
  • Loading branch information
skoogi authored May 23, 2020
2 parents 7c18545 + 4f69f07 commit 4498c69
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/services/oneid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ export class User {

const resp = await http.get(this.url(), data)
const results = resp.data.results.map(item => {
const {user, nodes} = item
return model.User.fromData({...user, nodes})
return model.User.fromData(item)
})
return {
count: resp.data.count,
Expand Down Expand Up @@ -169,8 +168,7 @@ export class User {
static async retrieve(id) {
const url = this.url({detail: true, id})
return http.get(url).then((x) => {
const {user, nodes} = x.data
return model.User.fromData({...user, nodes})
return model.User.fromData(x.data)
})
}

Expand Down

0 comments on commit 4498c69

Please sign in to comment.