Make names case insensitive for API
This commit is contained in:
@@ -58,7 +58,7 @@ func whoGet(namespace string, g storage.Graph, w http.ResponseWriter, r *http.Re
|
||||
return json.NewEncoder(w).Encode(entity.One{})
|
||||
}
|
||||
if len(ones) > 1 {
|
||||
return errors.New("more than one result found matching " + id)
|
||||
return fmt.Errorf("more than one result found matching %q: %+v", id, ones)
|
||||
}
|
||||
one := ones[0]
|
||||
|
||||
@@ -151,7 +151,7 @@ func whoDelete(namespace string, g storage.Graph, w http.ResponseWriter, r *http
|
||||
return json.NewEncoder(w).Encode(map[string]string{"error": err.Error()})
|
||||
}
|
||||
|
||||
if err := g.Delete(r.Context(), namespace, entity.One{Name: id}); err != nil {
|
||||
if err := g.Delete(r.Context(), namespace, operator.CaseInsensitive{Key: entity.Name, Value: id}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user