settings api

This commit is contained in:
cv
2021-04-19 22:53:29 +02:00
parent 394cdd396a
commit 86013bbb7a
4 changed files with 61 additions and 6 deletions
+16
View File
@@ -0,0 +1,16 @@
import axios from 'axios';
import { serverURL } from './apiConstants';
export const settingsNamespace = 'settings';
export const settingsURL = serverURL + settingsNamespace;
export const fetchSettings = async () => {
const res = await axios.get(settingsURL);
return res.data;
};
export const postSettings = async (data) => {
console.log('debug sending', data)
console.log('debug await', await axios.post(settingsURL, data))
const res = await axios.post(settingsURL, data);
return res;
};
@@ -28,7 +28,6 @@ export default function MessageControl() {
// Handle presenter messages
socket.on('messages-presenter', (data) => {
console.log('debug: stting data', data);
setPres({ ...data });
});
@@ -53,8 +52,6 @@ export default function MessageControl() {
};
}, [socket]);
console.log('debug', pres);
const messageControl = async (action, payload) => {
switch (action) {
case 'pres-text':