mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
Adding new Admin UI. Updating Fredy to V3.0.0 as it has been a large rewrite. Thanks for all contributions and help on the way!
20 lines
518 B
JavaScript
20 lines
518 B
JavaScript
import { xhrGet } from '../../xhr';
|
|
export const notificationAdapter = {
|
|
state: [],
|
|
reducers: {
|
|
setAdapter: (state, payload) => {
|
|
return [...Object.freeze(payload)];
|
|
},
|
|
},
|
|
effects: {
|
|
async getAdapter() {
|
|
try {
|
|
const response = await xhrGet('/api/jobs/notificationAdapter');
|
|
this.setAdapter(response.json);
|
|
} catch (Exception) {
|
|
console.error(`Error while trying to get resource for api/jobs/notificationAdapter. Error:`, Exception);
|
|
}
|
|
},
|
|
},
|
|
};
|