mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 07:27:58 +00:00
Requested changes
This commit is contained in:
@@ -13,22 +13,6 @@ export const pick = <T extends object, TKeys extends keyof T>(obj: T, keys: TKey
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Omit a list of properties from an object
|
|
||||||
* into a new object
|
|
||||||
*/
|
|
||||||
export const omit = <T extends object, TKeys extends keyof T>(obj: T, keys: TKeys[]): Omit<T, TKeys> => {
|
|
||||||
if (!obj) return {} as Omit<T, TKeys>;
|
|
||||||
return (Object.keys(obj) as TKeys[]).reduce(
|
|
||||||
(acc, key) => {
|
|
||||||
if (!keys.includes(key)) {
|
|
||||||
(acc as T)[key] = obj[key];
|
|
||||||
}
|
|
||||||
return acc;
|
|
||||||
},
|
|
||||||
{} as Omit<T, TKeys>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
/**
|
/**
|
||||||
* Removes (shakes out) undefined entries from an
|
* Removes (shakes out) undefined entries from an
|
||||||
* object. Optional second argument shakes out values
|
* object. Optional second argument shakes out values
|
||||||
|
|||||||
@@ -26,11 +26,9 @@ export const superAdminDALFactory = (db: TDbClient) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const updateById = async (id: string, data: TSuperAdminUpdate, tx?: Knex) => {
|
const updateById = async (id: string, data: TSuperAdminUpdate, tx?: Knex) => {
|
||||||
const updatedConfig = await superAdminOrm.transaction(async (trx) => {
|
const updatedConfig = await (superAdminOrm || tx).transaction(async (trx: Knex) => {
|
||||||
await superAdminOrm.updateById(id, data, tx || trx);
|
await superAdminOrm.updateById(id, data, trx);
|
||||||
const config = await findById(id, tx || trx);
|
return findById(id, trx);
|
||||||
|
|
||||||
return config;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return updatedConfig;
|
return updatedConfig;
|
||||||
|
|||||||
@@ -226,15 +226,15 @@ export const AdminDashboardPage = () => {
|
|||||||
dropdownContainerClassName="bg-mineshaft-800"
|
dropdownContainerClassName="bg-mineshaft-800"
|
||||||
defaultValue={field.value ?? " "}
|
defaultValue={field.value ?? " "}
|
||||||
onValueChange={(e) => {
|
onValueChange={(e) => {
|
||||||
if (e === " ") {
|
if (e === "EMPTY") {
|
||||||
onChange(null);
|
onChange("");
|
||||||
} else {
|
return;
|
||||||
onChange(e);
|
|
||||||
}
|
}
|
||||||
|
onChange(e);
|
||||||
}}
|
}}
|
||||||
{...field}
|
{...field}
|
||||||
>
|
>
|
||||||
<SelectItem value=" ">Select organization...</SelectItem>
|
<SelectItem value="EMPTY">Select organization...</SelectItem>
|
||||||
{organizations.data?.map((org) => (
|
{organizations.data?.map((org) => (
|
||||||
<SelectItem key={org.id} value={org.id}>
|
<SelectItem key={org.id} value={org.id}>
|
||||||
{org.name}
|
{org.name}
|
||||||
|
|||||||
Reference in New Issue
Block a user