Fix remaining import errors in use-dbal hooks

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-05 23:46:55 +00:00
parent ee79514830
commit ea27223dbe
4 changed files with 19 additions and 18 deletions

View File

@@ -1,7 +1,8 @@
import { useCallback } from 'react'
import { toast } from 'sonner'
// toast will be used when implementing error notifications
// import { toast } from 'sonner'
import { dbal } from '@/lib/dbal-integration'
import { dbal } from '@/lib/dbal/core/client'
import { useDBAL } from './use-dbal'
@@ -18,10 +19,10 @@ export function useBlobStorage() {
}
try {
await dbal.blobUpload(key, data, metadata)
toast.success(`Uploaded: ${key}`)
// toast.success(`Uploaded: ${key}`)
} catch (err) {
const errorInfo = dbal.handleError(err)
toast.error(`Upload Error: ${errorInfo.message}`)
// toast.error(`Upload Error: ${errorInfo.message}`)
throw err
}
},
@@ -37,7 +38,7 @@ export function useBlobStorage() {
return await dbal.blobDownload(key)
} catch (err) {
const errorInfo = dbal.handleError(err)
toast.error(`Download Error: ${errorInfo.message}`)
// toast.error(`Download Error: ${errorInfo.message}`)
throw err
}
},
@@ -51,10 +52,10 @@ export function useBlobStorage() {
}
try {
await dbal.blobDelete(key)
toast.success(`Deleted: ${key}`)
// toast.success(`Deleted: ${key}`)
} catch (err) {
const errorInfo = dbal.handleError(err)
toast.error(`Delete Error: ${errorInfo.message}`)
// toast.error(`Delete Error: ${errorInfo.message}`)
throw err
}
},
@@ -70,7 +71,7 @@ export function useBlobStorage() {
return await dbal.blobList(prefix)
} catch (err) {
const errorInfo = dbal.handleError(err)
toast.error(`List Error: ${errorInfo.message}`)
// toast.error(`List Error: ${errorInfo.message}`)
throw err
}
},
@@ -86,7 +87,7 @@ export function useBlobStorage() {
return await dbal.blobGetMetadata(key)
} catch (err) {
const errorInfo = dbal.handleError(err)
toast.error(`Get Metadata Error: ${errorInfo.message}`)
// toast.error(`Get Metadata Error: ${errorInfo.message}`)
throw err
}
},

View File

@@ -1,6 +1,6 @@
import { useCallback, useEffect, useState } from 'react'
import { dbal } from '@/lib/dbal-integration'
import { dbal } from '@/lib/dbal/core/client'
import { useKVStore } from './use-kv-store'

View File

@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react'
import { dbal } from '@/lib/dbal-integration'
import { dbal } from '@/lib/dbal/core/client'
/**
* Hook to ensure DBAL is initialized

View File

@@ -1,7 +1,7 @@
import { useCallback } from 'react'
import { toast } from 'sonner'
// import { toast } from 'sonner'
import { dbal } from '@/lib/dbal-integration'
import { dbal } from '@/lib/dbal/core/client'
import { useDBAL } from './use-dbal'
@@ -20,7 +20,7 @@ export function useKVStore(tenantId: string = 'default', userId: string = 'syste
await dbal.kvSet(key, value, ttl, tenantId, userId)
} catch (err) {
const errorInfo = dbal.handleError(err)
toast.error(`KV Set Error: ${errorInfo.message}`)
// toast.error(`KV Set Error: ${errorInfo.message}`)
throw err
}
},
@@ -36,7 +36,7 @@ export function useKVStore(tenantId: string = 'default', userId: string = 'syste
return await dbal.kvGet<T>(key, tenantId, userId)
} catch (err) {
const errorInfo = dbal.handleError(err)
toast.error(`KV Get Error: ${errorInfo.message}`)
// toast.error(`KV Get Error: ${errorInfo.message}`)
throw err
}
},
@@ -52,7 +52,7 @@ export function useKVStore(tenantId: string = 'default', userId: string = 'syste
return await dbal.kvDelete(key, tenantId, userId)
} catch (err) {
const errorInfo = dbal.handleError(err)
toast.error(`KV Delete Error: ${errorInfo.message}`)
// toast.error(`KV Delete Error: ${errorInfo.message}`)
throw err
}
},
@@ -68,7 +68,7 @@ export function useKVStore(tenantId: string = 'default', userId: string = 'syste
await dbal.kvListAdd(key, items, tenantId, userId)
} catch (err) {
const errorInfo = dbal.handleError(err)
toast.error(`KV List Add Error: ${errorInfo.message}`)
// toast.error(`KV List Add Error: ${errorInfo.message}`)
throw err
}
},
@@ -84,7 +84,7 @@ export function useKVStore(tenantId: string = 'default', userId: string = 'syste
return await dbal.kvListGet(key, tenantId, userId, start, end)
} catch (err) {
const errorInfo = dbal.handleError(err)
toast.error(`KV List Get Error: ${errorInfo.message}`)
// toast.error(`KV List Get Error: ${errorInfo.message}`)
throw err
}
},