mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 15:40:47 +00:00
PIT: hide restore button for last commit
This commit is contained in:
@@ -85,6 +85,7 @@ const commitSchema = z.object({
|
||||
envId: z.string(),
|
||||
createdAt: z.union([z.string(), z.date()]),
|
||||
updatedAt: z.union([z.string(), z.date()]),
|
||||
isLatest: z.boolean().default(false),
|
||||
changes: z.array(commitChangeSchema).optional()
|
||||
});
|
||||
|
||||
|
||||
@@ -1279,7 +1279,8 @@ export const folderCommitServiceFactory = ({
|
||||
});
|
||||
const changes = await folderCommitChangesDAL.findByCommitId(commitId, projectId);
|
||||
const commit = await folderCommitDAL.findById(commitId, undefined, projectId);
|
||||
return { ...commit, changes };
|
||||
const latestCommit = await folderCommitDAL.findLatestCommit(commit.folderId, projectId);
|
||||
return { ...commit, changes, isLatest: commit.id === latestCommit?.id };
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -325,6 +325,7 @@ export const secretV2BridgeServiceFactory = ({
|
||||
userId: inputSecret.type === SecretType.Personal ? actorId : null,
|
||||
tagIds: inputSecret.tagIds,
|
||||
references: nestedReferences,
|
||||
metadata: secretMetadata ? JSON.stringify(secretMetadata) : [],
|
||||
secretMetadata
|
||||
}
|
||||
],
|
||||
@@ -529,7 +530,7 @@ export const secretV2BridgeServiceFactory = ({
|
||||
skipMultilineEncoding: inputSecret.skipMultilineEncoding,
|
||||
key: inputSecret.newSecretName || secretName,
|
||||
tags: inputSecret.tagIds,
|
||||
metadata: JSON.stringify(secretMetadata),
|
||||
metadata: secretMetadata ? JSON.stringify(secretMetadata) : [],
|
||||
secretMetadata,
|
||||
...encryptedValue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user