Commit 4068eaf 1 parent 4e87605 commit 4068eaf Copy full SHA for 4068eaf
File tree 1 file changed +4
-38
lines changed
1 file changed +4
-38
lines changed Original file line number Diff line number Diff line change 1
1
import { DIDKeyValuePairsDataViewModel , DIDMetaViewModel } from "@/lib/infrastructure/data/view-model/did" ;
2
2
3
3
export async function didMetaQueryBase ( scope : string , name : string ) : Promise < DIDMetaViewModel > {
4
- const req : any = {
5
- method : "GET" ,
6
- url : new URL ( `${ process . env . NEXT_PUBLIC_WEBUI_HOST } /api/feature/get-did-meta` ) ,
7
- params : {
8
- "scope" : scope ,
9
- "name" : name
10
- } ,
11
- headers : new Headers ( {
12
- 'Content-Type' : 'application/json' ,
13
- } as HeadersInit )
14
- }
15
-
16
- const res = await fetch ( req . url , {
17
- method : "GET" ,
18
- headers : new Headers ( {
19
- 'Content-Type' : 'application/json' ,
20
- } as HeadersInit )
21
- } )
22
-
4
+ const url = `${ process . env . NEXT_PUBLIC_WEBUI_HOST } /api/feature/get-did-meta?` + new URLSearchParams ( { scope, name} )
5
+ const res = await fetch ( url )
23
6
return await res . json ( )
24
7
}
25
8
26
9
export async function didKeyValuePairsDataQuery ( scope : string , name : string ) : Promise < DIDKeyValuePairsDataViewModel > {
27
- const req : any = {
28
- method : "GET" ,
29
- url : new URL ( `${ process . env . NEXT_PUBLIC_WEBUI_HOST } /api/feature/get-did-keyvaluepairs` ) ,
30
- params : {
31
- "scope" : scope ,
32
- "name" : name
33
- } ,
34
- headers : new Headers ( {
35
- 'Content-Type' : 'application/json' ,
36
- } as HeadersInit )
37
- }
38
-
39
- const res = await fetch ( req . url , {
40
- method : "GET" ,
41
- headers : new Headers ( {
42
- 'Content-Type' : 'application/json' ,
43
- } as HeadersInit )
44
- } )
45
-
10
+ const url = `${ process . env . NEXT_PUBLIC_WEBUI_HOST } /api/feature/get-did-keyvaluepairs?` + new URLSearchParams ( { scope, name} )
11
+ const res = await fetch ( url )
46
12
return await res . json ( )
47
13
}
You can’t perform that action at this time.
0 commit comments