import { SYSTEM_SERVICE_PREFIX } from '@/constants/service';
import { request } from '../request';

const USER_PREFERENCE_THEME_PREFIX = `${SYSTEM_SERVICE_PREFIX}/user-preference/theme`;

/** 获取当前登录用户的主题偏好覆盖项 */
export function fetchGetUserPreferenceTheme() {
  return request<Api.UserPreference.ThemeSettings>({
    url: USER_PREFERENCE_THEME_PREFIX,
    method: 'get'
  });
}

/** 保存当前登录用户的主题偏好覆盖项 */
export function fetchSaveUserPreferenceTheme(data: Api.UserPreference.ThemeSettings) {
  return request<boolean>({
    url: USER_PREFERENCE_THEME_PREFIX,
    method: 'put',
    data
  });
}

/** 重置当前登录用户的主题偏好覆盖项 */
export function fetchResetUserPreferenceTheme() {
  return request<boolean>({
    url: USER_PREFERENCE_THEME_PREFIX,
    method: 'delete'
  });
}
