mirror of
https://github.com/ansible/awx.git
synced 2026-01-24 16:01:20 -03:30
allow more than 400 credential types in drop down while adding new credential
This commit is contained in:
parent
fa47e48a15
commit
61323c7f85
@ -86,14 +86,19 @@ function CredentialAdd({ me }) {
|
||||
const { data } = await CredentialTypesAPI.read({ page_size: 200 });
|
||||
const credTypes = data.results;
|
||||
if (data.next && data.next.includes('page=2')) {
|
||||
const {
|
||||
data: { results },
|
||||
} = await CredentialTypesAPI.read({
|
||||
page_size: 200,
|
||||
page: 2,
|
||||
});
|
||||
credTypes.concat(results);
|
||||
}
|
||||
let pageNo = 2;
|
||||
/* eslint-disable no-await-in-loop */
|
||||
do {
|
||||
const {
|
||||
data: { results },
|
||||
} = await CredentialTypesAPI.read({
|
||||
page_size: 200,
|
||||
page: pageNo,
|
||||
});
|
||||
credTypes.push(...results);
|
||||
pageNo++;
|
||||
} while (data.count !== credTypes.length);
|
||||
} /* eslint-enable no-await-in-loop */
|
||||
|
||||
const creds = credTypes.reduce((credentialTypesMap, credentialType) => {
|
||||
credentialTypesMap[credentialType.id] = credentialType;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user