mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Cleanup
This commit is contained in:
@@ -3,17 +3,14 @@ import repository from './repository'
|
||||
const resource = 'accounts'
|
||||
|
||||
export default {
|
||||
getAll({ domain, role }) {
|
||||
getAll(params) {
|
||||
return repository.get(`/${resource}/`, {
|
||||
params: { domain, role },
|
||||
params,
|
||||
paramsSerializer: {
|
||||
indexes: null,
|
||||
},
|
||||
})
|
||||
},
|
||||
getAllParams(params) {
|
||||
return repository.get(`${resource}/`, { params })
|
||||
},
|
||||
get(accountId) {
|
||||
return repository.get(`${resource}/${accountId}/`)
|
||||
},
|
||||
|
||||
@@ -130,9 +130,12 @@ function fetchAdministrators(domain) {
|
||||
|
||||
function fetchAccounts() {
|
||||
accountApi
|
||||
.getAll({ role: [constants.RESELLER, constants.DOMAIN_ADMIN] })
|
||||
.getAll({
|
||||
role: [constants.RESELLER, constants.DOMAIN_ADMIN],
|
||||
page_size: 50,
|
||||
})
|
||||
.then((resp) => {
|
||||
accounts.value = resp.data.filter(
|
||||
accounts.value = resp.data.results.filter(
|
||||
(account) =>
|
||||
administrators.value.find((admin) => admin.id === account.pk) ===
|
||||
undefined
|
||||
|
||||
@@ -329,7 +329,7 @@ async function fetchIdentities() {
|
||||
try {
|
||||
const resp =
|
||||
identityType.value === 'account'
|
||||
? await accountsApi.getAllParams(params)
|
||||
? await accountsApi.getAll(params)
|
||||
: await aliasesApi.getAll(params)
|
||||
identities.value = resp.data.results
|
||||
totalIdentities.value = resp.data.count
|
||||
|
||||
Reference in New Issue
Block a user