⚙️Settings-driven AirDC++ configuration first draft
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import axios from "axios";
|
||||
import { SETTINGS_OBJECT_FETCHED } from "../constants/action-types";
|
||||
import {
|
||||
SETTINGS_OBJECT_FETCHED,
|
||||
SETTINGS_OBJECT_DELETED,
|
||||
} from "../constants/action-types";
|
||||
import { SETTINGS_SERVICE_BASE_URI } from "../constants/endpoints";
|
||||
|
||||
export const saveSettings =
|
||||
@@ -29,3 +32,17 @@ export const getSettings = (settingsKey?) => async (dispatch) => {
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export const deleteSettings = () => async (dispatch) => {
|
||||
const result = await axios({
|
||||
url: `${SETTINGS_SERVICE_BASE_URI}/deleteSettings`,
|
||||
method: "POST",
|
||||
});
|
||||
|
||||
if (result.data.ok === 1) {
|
||||
dispatch({
|
||||
type: SETTINGS_OBJECT_FETCHED,
|
||||
data: {},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user