mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 18:27:36 +00:00
make some params optional
This commit is contained in:
@@ -29,8 +29,8 @@ interface SecretProps {
|
|||||||
|
|
||||||
interface FunctionProps {
|
interface FunctionProps {
|
||||||
env: string;
|
env: string;
|
||||||
setIsKeyAvailable: any;
|
setIsKeyAvailable?: any;
|
||||||
setData: any;
|
setData?: any;
|
||||||
workspaceId: string;
|
workspaceId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +58,9 @@ const getSecretsForProject = async ({
|
|||||||
|
|
||||||
const latestKey = await getLatestFileKey({ workspaceId });
|
const latestKey = await getLatestFileKey({ workspaceId });
|
||||||
// This is called isKeyAvailable but what it really means is if a person is able to create new key pairs
|
// This is called isKeyAvailable but what it really means is if a person is able to create new key pairs
|
||||||
setIsKeyAvailable(!latestKey ? encryptedSecrets.length === 0 : true);
|
if (typeof setIsKeyAvailable === 'function') {
|
||||||
|
setIsKeyAvailable(!latestKey ? encryptedSecrets.length === 0 : true);
|
||||||
|
}
|
||||||
|
|
||||||
const PRIVATE_KEY = localStorage.getItem('PRIVATE_KEY') as string;
|
const PRIVATE_KEY = localStorage.getItem('PRIVATE_KEY') as string;
|
||||||
|
|
||||||
@@ -131,7 +133,10 @@ const getSecretsForProject = async ({
|
|||||||
)[0]?.comment
|
)[0]?.comment
|
||||||
}));
|
}));
|
||||||
|
|
||||||
setData(result);
|
if (typeof setData === 'function') {
|
||||||
|
setData(result);
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('Something went wrong during accessing or decripting secrets.');
|
console.log('Something went wrong during accessing or decripting secrets.');
|
||||||
|
|||||||
Reference in New Issue
Block a user