implemented get all shares
This commit is contained in:
@@ -62,6 +62,16 @@ func StartWebserver(addr string, client client.Client, username, password string
|
||||
return
|
||||
}
|
||||
|
||||
shares, err := client.GetAllShares(r.Context())
|
||||
|
||||
if err != nil {
|
||||
logrus.Error(err.Error())
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(shares)
|
||||
}).Methods("GET")
|
||||
|
||||
r.HandleFunc("/api/share", func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user