Connected version history to backend

This commit is contained in:
Vladyslav Matsiiako
2022-12-27 15:02:50 -05:00
parent 2c63559303
commit bb4d3ba581
5 changed files with 425 additions and 20 deletions
@@ -149,6 +149,7 @@ const SideBar = ({
isFull={true}
/>
</div> */}
<SecretVersionList secretId={data[0].id} />
<CommentField comment={data.filter(secret => secret.type == "shared")[0]?.comment} modifyComment={modifyComment} position={data[0].pos} />
</div>
<div className={`flex justify-start max-w-sm mt-4 px-4 mt-full mb-[4.7rem]`}>
@@ -15,6 +15,7 @@ interface SecretProps {
value: string;
type: 'personal' | 'shared';
comment: string;
id: string;
}
interface Props {
@@ -85,6 +86,7 @@ const getSecretsForProject = async ({
}
tempFileState.push({
id: secretPair._id,
key: plainTextKey,
value: plainTextValue,
type: secretPair.type,
@@ -97,7 +99,7 @@ const getSecretsForProject = async ({
setData(
tempFileState.map((line, index) => {
return {
id: guidGenerator(),
id: line['id'],
pos: index,
key: line['key'],
value: line['value'],
@@ -109,7 +111,7 @@ const getSecretsForProject = async ({
return tempFileState.map((line, index) => {
return {
id: guidGenerator(),
id: line['id'],
pos: index,
key: line['key'],
value: line['value'],