0๐
โ
I ended up setting the values directly in the response.
setTheme() {
const payload = {
organisation: this.organisation
};
setTheme(payload)
.then(response => {
const theme = this.$vuetify.theme.themes.light;
const responseTheme = response.organisation.theme;
theme.primary = responseTheme.primary_color;
theme.secondary = responseTheme.secondary_color;
theme.accent = responseTheme.accent_color;
theme.error = responseTheme.error_color;
this.$store.dispatch("SET_THEME", response.data.organisation.theme);
})
.catch(e => {
this.errors.push(e);
});
},
Source:stackexchange.com