Browse Source

kong realtime

Fares 10 months ago
parent
commit
e195ac1ab2
1 changed files with 11 additions and 0 deletions
  1. 11 0
      lib/handlers/upload_handler.dart

+ 11 - 0
lib/handlers/upload_handler.dart

@@ -89,6 +89,17 @@ Future<Response> handleFileUpload(Request request) async {
               // Continue execution even if archive upload fails
             }
 
+            // No need to subscribe to channel
+            final channel = supabase.channel('csvhichstorage');
+            final res = await channel.sendBroadcastMessage(
+              event: "upload",
+              payload: {
+                "filename": filename,
+                "updated_at": now,
+              },
+            );
+            print("   realtime response: $res");
+
             await processCsvData(tempFile, supabase);
 
             //add filename ta list