feat(github): add list-repos dynamic data

This commit is contained in:
Ali BARIN
2022-10-18 20:55:51 +02:00
parent 51059b0f39
commit 12e73d59d5

View File

@@ -0,0 +1,21 @@
import { IGlobalVariable } from '@automatisch/types';
import paginateAll from '../../common/paginate-all';
export default {
name: 'List repos',
key: 'listRepos',
async run($: IGlobalVariable) {
const firstPageRequest = $.http.get('/user/repos');
const response = await paginateAll($, firstPageRequest);
response.data = response.data.map((repo: { full_name: string }) => {
return {
value: repo.full_name,
name: repo.full_name,
};
});
return response;
},
};