@@ -10,6 +10,7 @@ import { useInfiniteScroll } from "@/hooks/use-infinite-scroll";
1010import useAuth from "@/utils/useAuth" ;
1111import { useMasterKeyStore } from "@/store/master-key-store" ;
1212import { getConnections , updateConnectionName , deleteConnection } from "./connection-service" ;
13+ import { backendFetch } from "@/lib/backend-auth" ;
1314import { toast } from "sonner" ;
1415import { Tooltip , TooltipContent , TooltipProvider , TooltipTrigger } from "@/components/ui/tooltip" ;
1516import {
@@ -138,7 +139,7 @@ export function ExplorerSidebar({
138139
139140 setConnections ( prev => prev . map ( ( c , i ) => i === index ? { ...c , isLoading : true , error : null } : c ) ) ;
140141 try {
141- const res = await fetch ( "/api/nosql/connect" , {
142+ const res = await backendFetch ( "/api/nosql/connect" , {
142143 method : "POST" ,
143144 headers : { "Content-Type" : "application/json" } ,
144145 body : JSON . stringify ( { connectionString : connection . connectionString } ) ,
@@ -198,7 +199,7 @@ export function ExplorerSidebar({
198199 const refreshCollections = async ( connIndex : number , dbName : string ) => {
199200 const node = connections [ connIndex ] ;
200201 try {
201- const res = await fetch ( "/api/nosql/collections" , {
202+ const res = await backendFetch ( "/api/nosql/collections" , {
202203 method : "POST" ,
203204 headers : { "Content-Type" : "application/json" } ,
204205 body : JSON . stringify ( {
@@ -264,7 +265,7 @@ export function ExplorerSidebar({
264265
265266 const node = connections [ connIndex ] ;
266267 try {
267- const res = await fetch ( "/api/nosql/database/drop" , {
268+ const res = await backendFetch ( "/api/nosql/database/drop" , {
268269 method : "POST" ,
269270 headers : { "Content-Type" : "application/json" } ,
270271 body : JSON . stringify ( { connectionString : node . connection . connectionString , dbName } ) ,
@@ -284,7 +285,7 @@ export function ExplorerSidebar({
284285
285286 const node = connections [ connIndex ] ;
286287 try {
287- const res = await fetch ( "/api/nosql/collection/drop" , {
288+ const res = await backendFetch ( "/api/nosql/collection/drop" , {
288289 method : "POST" ,
289290 headers : { "Content-Type" : "application/json" } ,
290291 body : JSON . stringify ( { connectionString : node . connection . connectionString , dbName, collectionName } ) ,
@@ -304,7 +305,7 @@ export function ExplorerSidebar({
304305 if ( ! connection || ! newName ) return ;
305306
306307 try {
307- const res = await fetch ( "/api/nosql/collection/rename" , {
308+ const res = await backendFetch ( "/api/nosql/collection/rename" , {
308309 method : "POST" ,
309310 headers : { "Content-Type" : "application/json" } ,
310311 body : JSON . stringify ( {
@@ -335,7 +336,7 @@ export function ExplorerSidebar({
335336 if ( ! connection || ! newName ) return ;
336337
337338 try {
338- const res = await fetch ( "/api/nosql/database/rename" , {
339+ const res = await backendFetch ( "/api/nosql/database/rename" , {
339340 method : "POST" ,
340341 headers : { "Content-Type" : "application/json" } ,
341342 body : JSON . stringify ( {
0 commit comments