From 35f2e0e45d0e1f8aa709d927c6354433b5577d46 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Mon, 19 Aug 2024 00:23:18 +0200 Subject: Pages: File: Add functionality to restore button --- src/pages/File.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/File.tsx b/src/pages/File.tsx index 4e06d01..5a69d01 100644 --- a/src/pages/File.tsx +++ b/src/pages/File.tsx @@ -65,6 +65,11 @@ export default function File(props: any) { return parts[parts.length - 1] } + const restoreFile = async (file: FSTracerFile) => { + console.log("RESTORING FILE: user_id: ", props.session.user.id, " file: ", file.absolute_path, " ", file.contents, " ", file.timestamp) + await props.supabase.from('restored_file').insert({ absolute_path: file.absolute_path, contents: file.contents, timestamp: file.timestamp, user_id: props.session.user.id }) + } + return ( <>
@@ -85,7 +90,7 @@ export default function File(props: any) {
{files.map((currFile: FSTracerFile) => (
- {currFile.absolute_path} - {currFile.timestamp} {currFile.id === file.id && "*"} + {currFile.absolute_path} - {currFile.timestamp} {currFile.id === file.id && "*"}
)) } -- cgit 1.4.1