mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
27 lines
599 B
JavaScript
27 lines
599 B
JavaScript
import { xhrGet } from '../../xhr';
|
|
|
|
export const generalSettings = {
|
|
state: {
|
|
settings: {},
|
|
},
|
|
reducers: {
|
|
//only admins
|
|
setGeneralSettings: (state, payload) => {
|
|
return {
|
|
...state,
|
|
settings: payload,
|
|
};
|
|
},
|
|
},
|
|
effects: {
|
|
async getGeneralSettings() {
|
|
try {
|
|
const response = await xhrGet('/api/admin/generalSettings');
|
|
this.setGeneralSettings(response.json);
|
|
} catch (Exception) {
|
|
console.error('Error while trying to get resource for api/admin/generalSettings. Error:', Exception);
|
|
}
|
|
},
|
|
},
|
|
};
|