refactor: set data as a map instead of list

This commit is contained in:
lemmy mwaura
2022-12-10 22:24:02 +03:00
parent 6d1dc3845b
commit 968af64ee7
2 changed files with 37 additions and 36 deletions
@@ -68,13 +68,14 @@ const getSecretsForProject = async ({
setFileState(tempFileState);
setData(
tempFileState.map((line, index) => [
guidGenerator(),
index,
line["key"],
line["value"],
line["type"],
])
tempFileState.map((line, index) => {
return {
id: guidGenerator(),
key: line["key"],
value: line["value"],
type: line["type"]
}
})
// .sort((a, b) =>
// sortMethod == "alphabetical"
// ? a[2].localeCompare(b[2])