v1.6.2/admin dashboard
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import firebase from 'firebase/app';
|
||||
import 'firebase/auth';
|
||||
|
||||
const API = 'http://localhost:5000/watch-party-crx/us-central1/admin';
|
||||
|
||||
const fetcher = async ({ endpoint, method, bodyData }) => {
|
||||
const idToken = await firebase.auth().currentUser.getIdToken();
|
||||
const body = JSON.stringify(bodyData);
|
||||
return fetch(`${API}/${endpoint}`, {
|
||||
method,
|
||||
headers: {
|
||||
Authorization: `Token ${idToken}:${firebase.auth().currentUser.uid}`,
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
},
|
||||
body,
|
||||
});
|
||||
};
|
||||
|
||||
export const getPartyDashboardData = () => fetcher({ endpoint: 'partyDashboard', method: 'GET' });
|
||||
export const getServerDashboardData = () => fetcher({ endpoint: 'serverDashboard', method: 'GET' });
|
||||
export const postUpdateVersionActive = (bodyData) =>
|
||||
fetcher({ endpoint: 'updateVersionActive', method: 'POST', bodyData });
|
||||
export const postUpdateVideoSelectors = (bodyData) =>
|
||||
fetcher({ endpoint: 'updateVideoSelectors', method: 'POST', bodyData });
|
||||
Reference in New Issue
Block a user