fjtui/test-sort.js

12 lines
461 B
JavaScript
Raw Normal View History

2026-06-02 00:02:10 +00:00
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', {
headers: { 'Authorization': 'token ' + config.token },
params: { sort: 'oldest' }
}).then(r => console.log(r.data.map(i => i.id + ' ' + i.created_at))).catch(e => console.error(e.message));