rename type to avoid naming conflict with component
This commit is contained in:
@@ -9,7 +9,11 @@ import { getCookie } from "@/ee/sso/utils/cookies";
|
||||
import { getBaseUrl } from "@/boot/axios";
|
||||
import { useStorage } from "@vueuse/core";
|
||||
|
||||
import type { SSOAccount, SSOProvider, SSOSettings } from "@/ee/sso/types/sso";
|
||||
import type {
|
||||
SSOAccount,
|
||||
SSOProvider,
|
||||
SSOSettingsType,
|
||||
} from "@/ee/sso/types/sso";
|
||||
|
||||
const baseUrl = "accounts";
|
||||
|
||||
@@ -63,12 +67,12 @@ export async function removeSSOProvider(id: number) {
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function fetchSSOSettings(): Promise<SSOSettings> {
|
||||
export async function fetchSSOSettings(): Promise<SSOSettingsType> {
|
||||
const { data } = await axios.get(`${baseUrl}/ssoproviders/settings/`);
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function updateSSOSettings(settings: SSOSettings) {
|
||||
export async function updateSSOSettings(settings: SSOSettingsType) {
|
||||
const { data } = await axios.post(
|
||||
`${baseUrl}/ssoproviders/settings/`,
|
||||
settings,
|
||||
|
@@ -136,7 +136,7 @@ import { getBaseUrl } from "@/boot/axios";
|
||||
import SSOProvidersForm from "@/ee/sso/components/SSOProvidersForm.vue";
|
||||
|
||||
// types
|
||||
import { type SSOProvider } from "@/ee/sso/types/sso";
|
||||
import { type SSOProvider, SSOSettingsType } from "@/ee/sso/types/sso";
|
||||
import SSOSettings from "@/ee/sso/components/SSOSettings.vue";
|
||||
|
||||
// setup quasar
|
||||
@@ -232,7 +232,7 @@ function getCallbackURL(provider: SSOProvider) {
|
||||
function openSSOSettings() {
|
||||
$q.dialog({
|
||||
component: SSOSettings,
|
||||
}).onOk((ssoSettings: SSOSettings) => {
|
||||
}).onOk((ssoSettings: SSOSettingsType) => {
|
||||
store.commit("setBlockLocalUserLogon", ssoSettings.block_local_user_logon);
|
||||
});
|
||||
}
|
||||
|
@@ -56,14 +56,14 @@ import { notifySuccess } from "@/utils/notify";
|
||||
import { fetchSSOSettings, updateSSOSettings } from "@/ee/sso/api/sso";
|
||||
|
||||
// types
|
||||
import { SSOSettings } from "../types/sso";
|
||||
import { SSOSettingsType } from "../types/sso";
|
||||
|
||||
// define emits
|
||||
defineEmits([...useDialogPluginComponent.emits]);
|
||||
|
||||
const { dialogRef, onDialogHide, onDialogOK } = useDialogPluginComponent();
|
||||
|
||||
const ssoSettings = ref({} as SSOSettings);
|
||||
const ssoSettings = ref({} as SSOSettingsType);
|
||||
const loading = ref(false);
|
||||
|
||||
async function getSSOSettings() {
|
||||
|
@@ -27,7 +27,7 @@ export interface SSOUser extends User {
|
||||
social_accounts: SSOAccount[];
|
||||
}
|
||||
|
||||
export interface SSOSettings {
|
||||
export interface SSOSettingsType {
|
||||
sso_enabled: boolean;
|
||||
block_local_user_logon: boolean;
|
||||
}
|
||||
|
Reference in New Issue
Block a user