File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,10 @@ export async function get(path: string): Promise<any> {
52
52
53
53
export async function create ( path : string , body : any ) : Promise < any > {
54
54
try {
55
- return ( await superagent . post ( `/api/create?path=${ path } ` ) . send ( JSON . parse ( body ) ) ) . body
55
+ return ( await superagent . post ( `/api/create?path=${ path } ` )
56
+ . set ( 'Content-Type' , 'application/json' )
57
+ . send ( JSON . parse ( body ) ) )
58
+ . body
56
59
} catch ( error ) {
57
60
console . log ( error )
58
61
return { error }
@@ -61,7 +64,9 @@ export async function create(path: string, body: any): Promise<any> {
61
64
62
65
export async function update ( path : string , body : any ) : Promise < any > {
63
66
try {
64
- return ( await superagent . put ( `/api/update?path=${ path } ` ) . send ( JSON . parse ( body ) ) ) . body
67
+ return ( await superagent . put ( `/api/update?path=${ path } ` )
68
+ . set ( 'Content-Type' , 'application/json' )
69
+ . send ( JSON . parse ( body ) ) ) . body
65
70
} catch ( error ) {
66
71
console . log ( error )
67
72
return { error }
You can’t perform that action at this time.
0 commit comments