mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-26 23:04:57 +00:00
Fix remaining import errors in use-dbal hooks
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user