Commit 9172b966 authored by Sandro Lutz's avatar Sandro Lutz
Browse files

Use language property in models

parent 0e2a492e
import m from 'mithril';
import { apiUrl } from './config';
import { getToken, getUserId, isLoggedIn } from './auth';
import { currentLanguage } from './language';
const lang = 'de';
const date = `${new Date().toISOString().split('.')[0]}Z`;
let querySaved = '';
......@@ -214,8 +214,8 @@ export function load(query = {}) {
.then(result => {
this.list = result._items.map(event => {
const newEvent = Object.assign({}, event);
newEvent.title = newEvent[`title_${lang}`];
newEvent.description = newEvent[`description_${lang}`];
newEvent.title = newEvent[`title_${currentLanguage()}`];
newEvent.description = newEvent[`description_${currentLanguage()}`];
return newEvent;
});
});
......
import m from 'mithril';
import { apiUrl } from './config';
import { getToken } from './auth';
import { currentLanguage } from './language';
const lang = 'de';
const date = `${new Date().toISOString().split('.')[0]}Z`;
let querySaved = {};
......@@ -55,8 +55,8 @@ export function load(query = {}) {
.then(result => {
this.list = result._items.map(event => {
const newOffer = Object.assign({}, event);
newOffer.title = newOffer[`title_${lang}`];
newOffer.description = newOffer[`description_${lang}`];
newOffer.title = newOffer[`title_${currentLanguage()}`];
newOffer.description = newOffer[`description_${currentLanguage()}`];
return newOffer;
});
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment