mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-08 00:43:54 +00:00
ce8d534953
welcome modal is persisted in app state created endpoints to set the visibility added UI to support feature Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>
29 lines
742 B
TypeScript
29 lines
742 B
TypeScript
import axios, { AxiosResponse } from 'axios';
|
|
import { Settings } from 'ontime-types';
|
|
|
|
import { apiEntryUrl } from './constants';
|
|
|
|
const settingsPath = `${apiEntryUrl}/settings`;
|
|
|
|
/**
|
|
* HTTP request to retrieve application settings
|
|
*/
|
|
export async function getSettings(): Promise<Settings> {
|
|
const res = await axios.get(settingsPath);
|
|
return res.data;
|
|
}
|
|
|
|
/**
|
|
* HTTP request to mutate application settings
|
|
*/
|
|
export async function postSettings(data: Settings): Promise<AxiosResponse<Settings>> {
|
|
return axios.post(settingsPath, data);
|
|
}
|
|
|
|
/**
|
|
* Allows setting the welcome modal dialog state from the clients
|
|
*/
|
|
export async function postShowWelcomeDialog(show: boolean) {
|
|
axios.post(`${settingsPath}/welcomedialog`, { show });
|
|
}
|