mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
added api fn to request git stats
This commit is contained in:
parent
29c3b8a26f
commit
2027ec65af
4 changed files with 18 additions and 2 deletions
|
@ -36,4 +36,7 @@ export const API = {
|
|||
EMBED: {
|
||||
YOUTUBE: '/embed/youtube',
|
||||
},
|
||||
BORIS: {
|
||||
GET_GIT_LOG: 'http://vault48.org/stats/git.json',
|
||||
},
|
||||
};
|
||||
|
|
|
@ -119,7 +119,7 @@ const BorisLayoutUnconnected: FC<IProps> = ({
|
|||
<Group className={styles.stats__container}>
|
||||
<div className={styles.stats__about}>
|
||||
<p>Здесь мы сидим и слушаем всё, что вас беспокоит.</p>
|
||||
<p>А потом чиним долгими дождливыми вечерами.</p>
|
||||
<p>Все виновные будут наказаны. Невиновные, впрочем, тоже. Такова жизнь.</p>
|
||||
</div>
|
||||
|
||||
{/*
|
||||
|
|
8
src/redux/boris/api.ts
Normal file
8
src/redux/boris/api.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
import Axios from 'axios';
|
||||
import { API } from '~/constants/api';
|
||||
import { resultMiddleware, errorMiddleware } from '~/utils/api';
|
||||
|
||||
export const getBorisGitStats = (): Promise<any> =>
|
||||
Axios.get(API.BORIS.GET_GIT_LOG)
|
||||
.then(resultMiddleware)
|
||||
.catch(errorMiddleware);
|
|
@ -1,9 +1,14 @@
|
|||
import { takeLatest, put } from 'redux-saga/effects';
|
||||
import { takeLatest, put, call } from 'redux-saga/effects';
|
||||
import { BORIS_ACTIONS } from './constants';
|
||||
import { borisSet } from './actions';
|
||||
import { getBorisGitStats } from './api';
|
||||
|
||||
function* loadStats() {
|
||||
yield put(borisSet({ is_loading: true }));
|
||||
|
||||
const result = yield getBorisGitStats();
|
||||
console.log(result);
|
||||
|
||||
yield put(borisSet({ is_loading: false }));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue