Skip to content

Commit

Permalink
chore: remove unneeded KV headers
Browse files Browse the repository at this point in the history
  • Loading branch information
sandros94 committed Sep 11, 2024
1 parent 6b6bd64 commit 5154b1a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
8 changes: 0 additions & 8 deletions src/runtime/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ export default defineNuxtPlugin(async ({ $config }) => {
onRequest({ options }) {
options.headers = options.headers || {}

// @ts-expect-error KV header type missing
if (defaultDB.KV && options.headers['surreal-KV'] === undefined) {
// @ts-expect-error KV header type missing
options.headers['surreal-KV'] = defaultDB.KV
}
// @ts-expect-error NS header type missing
if (defaultDB.NS && options.headers['surreal-NS'] === undefined) {
// @ts-expect-error NS header type missing
Expand Down Expand Up @@ -88,9 +83,6 @@ export default defineNuxtPlugin(async ({ $config }) => {
if (db.host) {
baseURL = db.host
}
if (db.KV) {
headers['surreal-KV'] = db.KV
}
if (db.NS) {
headers['surreal-NS'] = db.NS
}
Expand Down
8 changes: 0 additions & 8 deletions src/runtime/server/utils/surreal-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ export function useSurrealFetch<
onRequest({ options }) {
options.headers = options.headers || {}

// @ts-expect-error KV header type missing
if (defaultDB.KV && options.headers['surreal-KV'] === undefined) {
// @ts-expect-error KV header type missing
options.headers['surreal-KV'] = defaultDB.KV
}
// @ts-expect-error NS header type missing
if (defaultDB.NS && options.headers['surreal-NS'] === undefined) {
// @ts-expect-error NS header type missing
Expand Down Expand Up @@ -153,9 +148,6 @@ export function useSurrealFetchOptionsOverride<
if (db.host) {
baseURL = db.host
}
if (db.KV) {
headers['surreal-KV'] = db.KV
}
if (db.NS) {
headers['surreal-NS'] = db.NS
}
Expand Down
1 change: 0 additions & 1 deletion src/runtime/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export interface ServerOverrides {
export interface DatabasePreset {
host?: string
ws?: string
KV?: string
NS?: string
DB?: string
SC?: string
Expand Down

0 comments on commit 5154b1a

Please sign in to comment.