mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 11:23:50 +00:00
22 lines
509 B
TypeScript
22 lines
509 B
TypeScript
import axios from 'axios';
|
|
import { ViewSettings } from 'ontime-types';
|
|
|
|
import { apiEntryUrl } from './constants';
|
|
|
|
const viewSettingsPath = `${apiEntryUrl}/view-settings`;
|
|
|
|
/**
|
|
* HTTP request to retrieve view settings
|
|
*/
|
|
export async function getView(): Promise<ViewSettings> {
|
|
const res = await axios.get(viewSettingsPath);
|
|
return res.data;
|
|
}
|
|
|
|
/**
|
|
* HTTP request to mutate view settings
|
|
*/
|
|
export async function postViewSettings(data: ViewSettings) {
|
|
return axios.post(viewSettingsPath, data);
|
|
}
|