lib/fs, lib/api, lib/model: Expose mtime remappings as part of /db/file (#7624)

* lib/fs, lib/api, lib/model: Expose mtime remappings as part of /db/file

* Fix wrong error returned by CLI

* Gofmt

* Better names

* Review comments

* Review comments
This commit is contained in:
Audrius Butkevicius
2021-05-03 11:28:25 +01:00
committed by GitHub
parent f09dcb98eb
commit 87a0eecc31
16 changed files with 305 additions and 111 deletions
+3 -3
View File
@@ -135,11 +135,11 @@ func (c *apiClient) Post(url, body string) (*http.Response, error) {
}
func checkResponse(response *http.Response) error {
if response.StatusCode == 404 {
if response.StatusCode == http.StatusNotFound {
return errors.New("invalid endpoint or API call")
} else if response.StatusCode == 403 {
} else if response.StatusCode == http.StatusUnauthorized {
return errors.New("invalid API key")
} else if response.StatusCode != 200 {
} else if response.StatusCode != http.StatusOK {
data, err := responseToBArray(response)
if err != nil {
return err