15 lines
704 B
JavaScript
15 lines
704 B
JavaScript
|
|
import fs from 'fs';
|
||
|
|
import os from 'os';
|
||
|
|
import axios from 'axios';
|
||
|
|
|
||
|
|
const configPath = os.homedir() + '/.config/fjtui/fjtui.json';
|
||
|
|
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
||
|
|
|
||
|
|
axios.get(config.url + '/api/v1/repos/' + config.repo + '/issues?state=all', {
|
||
|
|
headers: { 'Authorization': 'token ' + config.token }
|
||
|
|
}).then(r => console.log('NO SORT: ' + r.data.map(i => i.id).join(', '))).catch(e => console.error(e.message));
|
||
|
|
|
||
|
|
axios.get(config.url + '/api/v1/repos/' + config.repo + '/issues?state=all&sort=oldest', {
|
||
|
|
headers: { 'Authorization': 'token ' + config.token }
|
||
|
|
}).then(r => console.log('OLDEST: ' + r.data.map(i => i.id).join(', '))).catch(e => console.error(e.message));
|