18 lines
422 B
TypeScript
18 lines
422 B
TypeScript
import { get, put } from './lib';
|
|
|
|
const emptySettings = {};
|
|
|
|
export const getSettings = async () => {
|
|
try {
|
|
return (await get('settings', true)).doc;
|
|
} catch (err) {
|
|
console.error({ caller: 'getSettings', err });
|
|
return emptySettings;
|
|
}
|
|
};
|
|
|
|
export const putSettings = async (params: any) => {
|
|
const { settings } = params;
|
|
return await put('settings', 'settings', (_: any) => settings, {}, true);
|
|
};
|