File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -5,16 +5,16 @@ import type { FetchOptions, ResponseType } from 'ofetch'
5
5
import { ofetch } from 'ofetch'
6
6
import { textToBase64 } from 'undio'
7
7
8
- import type { DatabasePreset , Overrides , RpcRequest } from './types'
9
- import { createError , defineNuxtPlugin , useSurrealAuth } from '#imports'
8
+ import type { DatabasePreset , DatabasePresetKeys , Overrides , RpcRequest } from './types'
9
+ import { createError , defineNuxtPlugin , useSurrealAuth , useSurrealDatabases } from '#imports'
10
10
11
11
export default defineNuxtPlugin ( async ( { $config } ) => {
12
12
const {
13
- databases,
14
13
defaultDatabase,
15
14
auth : { database : authDatabase } ,
16
15
} = $config . public . surrealdb
17
- const defaultDB = databases [ defaultDatabase as keyof PublicRuntimeConfig [ 'surrealdb' ] [ 'databases' ] ] as DatabasePreset
16
+ const databases = useSurrealDatabases ( )
17
+ const defaultDB = databases [ defaultDatabase as DatabasePresetKeys ] as DatabasePreset
18
18
const { token : userAuth , session } = useSurrealAuth ( )
19
19
20
20
const authToken = authTokenFn ( defaultDB . auth )
You can’t perform that action at this time.
0 commit comments