forked from baron/baron-sso
refactor(adminfront): rename legacy companyCode to tenantSlug across frontend (#426)
This commit is contained in:
@@ -352,7 +352,7 @@ export type UserSummary = {
|
||||
phone?: string;
|
||||
role: string;
|
||||
status: string;
|
||||
companyCode?: string;
|
||||
tenantSlug?: string;
|
||||
tenant?: TenantSummary;
|
||||
joinedTenants?: TenantSummary[]; // [New] 다중 소속 테넌트 목록
|
||||
metadata?: Record<string, unknown>;
|
||||
@@ -376,7 +376,7 @@ export type UserCreateRequest = {
|
||||
name: string;
|
||||
phone?: string;
|
||||
role?: string;
|
||||
companyCode?: string;
|
||||
tenantSlug?: string;
|
||||
department?: string;
|
||||
position?: string;
|
||||
jobTitle?: string;
|
||||
@@ -392,7 +392,7 @@ export type UserUpdateRequest = {
|
||||
phone?: string;
|
||||
role?: string;
|
||||
status?: string;
|
||||
companyCode?: string;
|
||||
tenantSlug?: string;
|
||||
department?: string;
|
||||
position?: string;
|
||||
jobTitle?: string;
|
||||
@@ -403,7 +403,7 @@ export type BulkUserItem = {
|
||||
name: string;
|
||||
phone?: string;
|
||||
role?: string;
|
||||
companyCode?: string;
|
||||
tenantSlug?: string;
|
||||
department?: string;
|
||||
metadata?: Record<string, unknown>;
|
||||
};
|
||||
@@ -423,10 +423,10 @@ export async function fetchUsers(
|
||||
limit = 50,
|
||||
offset = 0,
|
||||
search?: string,
|
||||
companyCode?: string,
|
||||
tenantSlug?: string,
|
||||
) {
|
||||
const { data } = await apiClient.get<UserListResponse>("/v1/admin/users", {
|
||||
params: { limit, offset, search, companyCode },
|
||||
params: { limit, offset, search, tenantSlug },
|
||||
});
|
||||
return data;
|
||||
}
|
||||
@@ -446,10 +446,10 @@ export async function createUser(payload: UserCreateRequest) {
|
||||
return data;
|
||||
}
|
||||
|
||||
export function exportUsersCSVUrl(search?: string, companyCode?: string) {
|
||||
export function exportUsersCSVUrl(search?: string, tenantSlug?: string) {
|
||||
const params = new URLSearchParams();
|
||||
if (search) params.append("search", search);
|
||||
if (companyCode) params.append("companyCode", companyCode);
|
||||
if (tenantSlug) params.append("tenantSlug", tenantSlug);
|
||||
|
||||
// Get mock role from storage if exists for dev environment
|
||||
const mockRole = window.localStorage.getItem("X-Mock-Role");
|
||||
@@ -503,7 +503,7 @@ export type UserProfileResponse = {
|
||||
role: string;
|
||||
department: string;
|
||||
affiliationType: string;
|
||||
companyCode?: string;
|
||||
tenantSlug?: string;
|
||||
tenantId?: string;
|
||||
metadata?: Record<string, unknown>;
|
||||
tenant?: TenantSummary;
|
||||
|
||||
@@ -8,15 +8,15 @@ describe("i18n utility", () => {
|
||||
});
|
||||
|
||||
it("returns fallback if key not found", () => {
|
||||
expect(t("non.existent.key", "Fallback")).toBe("Fallback");
|
||||
expect(t("this.key.truly.does.not.exist", "Fallback")).toBe("Fallback");
|
||||
});
|
||||
|
||||
it("returns key if fallback not provided and key not found", () => {
|
||||
expect(t("non.existent.key")).toBe("non.existent.key");
|
||||
expect(t("this.key.truly.does.not.exist")).toBe("this.key.truly.does.not.exist");
|
||||
});
|
||||
|
||||
it("replaces variables in template", () => {
|
||||
expect(t("test.key", "Hello {{ name }}", { name: "World" })).toBe(
|
||||
expect(t("this.test.key", "Hello {{ name }}", { name: "World" })).toBe(
|
||||
"Hello World",
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user