⚙️Settings-driven AirDC++ configuration first draft

This commit is contained in:
2021-11-19 13:49:39 -08:00
parent 2104f12e8f
commit 725c156e88
10 changed files with 161 additions and 85 deletions

View File

@@ -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: {},
});
}
};