Put commit hash and build time on admin page

This commit is contained in:
2017-02-17 12:15:37 +00:00
parent a880a5f2bc
commit a5ea6dc035
4 changed files with 45 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
import React from 'react';
import Layout from '../../components/Layout';
import fetchQL from '../../core/fetchQL';
import fetch from '../../core/fetch';
import { starters, mains } from '../../config';
const title = 'Admin';
@@ -11,7 +12,14 @@ export default {
async action() {
const resp = await fetchQL('{getAllPersons{key,firstname,lastname,email,password,completed,starter,main}}');
const configResp = await fetch('/config.json', {
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
});
const { data } = await resp.json();
const config = await configResp.json();
const people = data.getAllPersons || [];
const food = {
@@ -37,6 +45,7 @@ export default {
people={people}
starters={food.starters}
mains={food.mains}
build={config.build}
/></Layout>,
};
},