Skip to content

Commit

Permalink
rename type to avoid naming conflict with component
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Oct 31, 2024
1 parent 54207d1 commit 02eeea5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
10 changes: 7 additions & 3 deletions src/ee/sso/api/sso.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/ee/sso/components/SSOProvidersTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/ee/sso/components/SSOSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion src/ee/sso/types/sso.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 02eeea5

Please sign in to comment.