Externalized event-storage

This commit is contained in:
Johanna Dorothea Reichmann 2019-03-04 14:14:32 +01:00
parent 35c988aeff
commit 364ffe975d
Signed by untrusted user who does not match committer: transcaffeine
GPG Key ID: 03624C433676E465
2 changed files with 7 additions and 4 deletions

3
events.json Normal file
View File

@ -0,0 +1,3 @@
[
{"name" : "Easterhegg19", "description" : "EH19: Bun Intended!", "date" : "2019-04-19T10:00:00.000+01:00"}
]

View File

@ -1,11 +1,11 @@
(function(window) { (function(window) {
function fetchEvents() { function fetchEvents() {
const events = [
{name: "EH19", date: "2019-04-19T10:00:00.000+01:00", description: "Wien c:"}
];
return new Promise((fullfill, reject) => { return new Promise((fullfill, reject) => {
fullfill(events) fetch('./events.json')
.then(answer => answer.json())
.then(events => fullfill(events))
.catch(err => reject(err))
}) })
} }