Skip to content

Commit

Permalink
Fix invalid handling of requests
Browse files Browse the repository at this point in the history
  • Loading branch information
MytsV authored and maany committed Aug 8, 2024
1 parent 4e87605 commit 4068eaf
Showing 1 changed file with 4 additions and 38 deletions.
42 changes: 4 additions & 38 deletions src/app/(rucio)/did/queries.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,13 @@
import { DIDKeyValuePairsDataViewModel, DIDMetaViewModel } from "@/lib/infrastructure/data/view-model/did";

export async function didMetaQueryBase(scope: string, name: string): Promise<DIDMetaViewModel> {
const req: any = {
method: "GET",
url: new URL(`${process.env.NEXT_PUBLIC_WEBUI_HOST}/api/feature/get-did-meta`),
params: {
"scope": scope,
"name": name
},
headers: new Headers({
'Content-Type': 'application/json',
} as HeadersInit)
}

const res = await fetch(req.url, {
method: "GET",
headers: new Headers({
'Content-Type': 'application/json',
} as HeadersInit)
})

const url = `${process.env.NEXT_PUBLIC_WEBUI_HOST}/api/feature/get-did-meta?` + new URLSearchParams({scope, name})
const res = await fetch(url)
return await res.json()
}

export async function didKeyValuePairsDataQuery(scope: string, name: string): Promise<DIDKeyValuePairsDataViewModel> {
const req: any = {
method: "GET",
url: new URL(`${process.env.NEXT_PUBLIC_WEBUI_HOST}/api/feature/get-did-keyvaluepairs`),
params: {
"scope": scope,
"name": name
},
headers: new Headers({
'Content-Type': 'application/json',
} as HeadersInit)
}

const res = await fetch(req.url, {
method: "GET",
headers: new Headers({
'Content-Type': 'application/json',
} as HeadersInit)
})

const url = `${process.env.NEXT_PUBLIC_WEBUI_HOST}/api/feature/get-did-keyvaluepairs?` + new URLSearchParams({scope, name})
const res = await fetch(url)
return await res.json()
}

0 comments on commit 4068eaf

Please sign in to comment.