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

Duplicated code #567

Open
orballo opened this issue May 18, 2022 · 0 comments
Open

Duplicated code #567

orballo opened this issue May 18, 2022 · 0 comments
Labels
type: chore Updating packages, cleanup, etc

Comments

@orballo
Copy link

orballo commented May 18, 2022

Hi there,

I was just having a look at the code and I noticed that this part is duplicated, or at least overridden by the next lines, as the keys users and invites are defined again after this code:

admin/src/services/api.js

Lines 682 to 733 in 8189ab1

invites: {
create(data) {
const path = `/admin/invites`
return medusaRequest("POST", path, data)
},
resend(inviteId) {
const path = `/admin/invites/${inviteId}/resend`
return medusaRequest("POST", path)
},
delete(inviteId) {
const path = `/admin/invites/${inviteId}`
return medusaRequest("DELETE", path)
},
list() {
const path = `/admin/invites`
return medusaRequest("GET", path)
},
accept(data) {
const path = `/admin/invites/accept`
return medusaRequest("POST", path, data)
},
},
users: {
resetPasswordToken(data) {
const path = `/admin/users/password-token`
return medusaRequest("POST", path, data)
},
resetPassword(data) {
const path = `/admin/users/reset-password`
return medusaRequest("POST", path, data)
},
list() {
const path = `/admin/users`
return medusaRequest("GET", path)
},
retrieve(userId) {
const path = `/admin/users/${userId}`
return medusaRequest("GET", path)
},
update(userId, data) {
const path = `/admin/users/${userId}`
return medusaRequest("POST", path, data)
},
delete(userId) {
const path = `/admin/users/${userId}`
return medusaRequest("DELETE", path)
},
},

I thought it would be good to let you know :)

@olivermrbl olivermrbl added the type: chore Updating packages, cleanup, etc label Jul 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: chore Updating packages, cleanup, etc
Projects
None yet
Development

No branches or pull requests

2 participants