Skip to content

Commit e621388

Browse files
author
Jay D
authored
compatibility (#1)
* fix: try to parse 1.2.0 appwrite response * fix: try to parse 1.2.0 appwrite response * fix: compatibility
1 parent 3e10b12 commit e621388

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

appwrite/client.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ type Client struct {
6363
// NewClient initializes a new Appwrite client with a given timeout
6464
func NewClient() Client {
6565
headers := map[string]string{
66-
"X-Appwrite-Response-Format" : "0.7.0",
66+
"X-Appwrite-Response-Format" : "1.2.0",
6767
"x-sdk-name": "NAME",
6868
"x-sdk-platform": "",
6969
"x-sdk-language": "go",
@@ -316,15 +316,11 @@ func (clt *Client) Call(method string, path string, headers map[string]interface
316316
message: message,
317317
}
318318
}
319-
output, ok := jsonResponse["result"].(string)
320-
if !ok {
321-
return nil, fmt.Errorf("invalid response type %v", jsonResponse)
322-
}
323319
return &ClientResponse{
324320
Status: resp.Status,
325321
StatusCode: resp.StatusCode,
326322
Header: resp.Header,
327-
Result: string(output),
323+
Result: string(responseData),
328324
}, nil
329325
}
330326
output, err := getOutput(params, fileNameKey, responseData, resp.Header.Get("content-type"))

0 commit comments

Comments
 (0)