|
@@ -23,12 +23,11 @@ export const showDomainInput = () => ({ type: SHOW_DOMAIN_INPUT });
|
|
|
|
|
|
|
|
export const getUserSettings = () => async dispatch => {
|
|
export const getUserSettings = () => async dispatch => {
|
|
|
try {
|
|
try {
|
|
|
- const { data: { apikey, customDomain, homepage, useHttps } } = await axios.get(
|
|
|
|
|
- '/api/auth/usersettings',
|
|
|
|
|
- {
|
|
|
|
|
- headers: { Authorization: cookie.get('token') },
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ const {
|
|
|
|
|
+ data: { apikey, customDomain, homepage, useHttps },
|
|
|
|
|
+ } = await axios.get('/api/auth/usersettings', {
|
|
|
|
|
+ headers: { Authorization: cookie.get('token') },
|
|
|
|
|
+ });
|
|
|
dispatch(setDomain({ customDomain, homepage, useHttps }));
|
|
dispatch(setDomain({ customDomain, homepage, useHttps }));
|
|
|
dispatch(setApiKey(apikey));
|
|
dispatch(setApiKey(apikey));
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
@@ -39,13 +38,11 @@ export const getUserSettings = () => async dispatch => {
|
|
|
export const setCustomDomain = params => async dispatch => {
|
|
export const setCustomDomain = params => async dispatch => {
|
|
|
dispatch(showDomainLoading());
|
|
dispatch(showDomainLoading());
|
|
|
try {
|
|
try {
|
|
|
- const { data: { customDomain, homepage, useHttps } } = await axios.post(
|
|
|
|
|
- '/api/url/customdomain',
|
|
|
|
|
- params,
|
|
|
|
|
- {
|
|
|
|
|
- headers: { Authorization: cookie.get('token') },
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ const {
|
|
|
|
|
+ data: { customDomain, homepage, useHttps },
|
|
|
|
|
+ } = await axios.post('/api/url/customdomain', params, {
|
|
|
|
|
+ headers: { Authorization: cookie.get('token') },
|
|
|
|
|
+ });
|
|
|
dispatch(setDomain({ customDomain, homepage, useHttps }));
|
|
dispatch(setDomain({ customDomain, homepage, useHttps }));
|
|
|
} catch ({ response }) {
|
|
} catch ({ response }) {
|
|
|
dispatch(setDomainError(response.data.error));
|
|
dispatch(setDomainError(response.data.error));
|