mirror of
https://github.com/logos-storage/logos-storage-go.git
synced 2026-01-02 13:23:11 +00:00
updates API from "has" to "exists"
This commit is contained in:
parent
ca8b1dd5f6
commit
d8b762ea06
@ -78,7 +78,7 @@ func (c *CodexClient) LocalDownload(cid string, output io.Writer) error {
|
||||
}
|
||||
|
||||
func (c *CodexClient) HasCid(cid string) (bool, error) {
|
||||
url := fmt.Sprintf("%s/api/codex/v1/data/%s/has", c.BaseURL, cid)
|
||||
url := fmt.Sprintf("%s/api/codex/v1/data/%s/exists", c.BaseURL, cid)
|
||||
|
||||
resp, err := c.Client.Get(url)
|
||||
if err != nil {
|
||||
|
||||
@ -158,7 +158,7 @@ func TestHasCid_Success(t *testing.T) {
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path != "/api/codex/v1/data/"+tt.cid+"/has" {
|
||||
if r.URL.Path != "/api/codex/v1/data/"+tt.cid+"/exists" {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user