bump libre-graph-go

This commit is contained in:
Florian Schade
2022-12-29 10:30:22 +01:00
parent dc4e47ac00
commit 8db120c39a
5 changed files with 10 additions and 12 deletions
+4 -4
View File
@@ -248,7 +248,7 @@ func (g Graph) CreateDrive(w http.ResponseWriter, r *http.Request) {
errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, "invalid body schema definition")
return
}
spaceName := strings.TrimSpace(*drive.Name)
spaceName := strings.TrimSpace(drive.Name)
if err := validateSpaceName(spaceName); err != nil {
logger.Debug().Str("name", spaceName).Err(err).Msg("could not create drive: name validation failed")
errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, fmt.Sprintf("invalid spacename: %s", err.Error()))
@@ -392,8 +392,8 @@ func (g Graph) UpdateDrive(w http.ResponseWriter, r *http.Request) {
}
}
if drive.Name != nil {
spacename := strings.TrimSpace(*drive.Name)
if drive.Name != "" {
spacename := strings.TrimSpace(drive.Name)
if err := validateSpaceName(spacename); err != nil {
logger.Info().Err(err).Msg("could not update drive: spacename invalid")
errorcode.GeneralException.Render(w, r, http.StatusBadRequest, err.Error())
@@ -599,7 +599,7 @@ func (g Graph) cs3StorageSpaceToDrive(ctx context.Context, baseURL *url.URL, spa
drive := &libregraph.Drive{
Id: libregraph.PtrString(spaceID),
Name: &space.Name,
Name: space.Name,
//"createdDateTime": "string (timestamp)", // TODO read from StorageSpace ... needs Opaque for now
DriveType: &space.SpaceType,
Root: &libregraph.DriveItem{
+2 -2
View File
@@ -24,7 +24,7 @@ type spacesByLastModifiedDateTime struct {
// Less reports whether the element with index i
// must sort before the element with index j.
func (s spacesByName) Less(i, j int) bool {
return strings.ToLower(*s.spacesSlice[i].Name) < strings.ToLower(*s.spacesSlice[j].Name)
return strings.ToLower(s.spacesSlice[i].Name) < strings.ToLower(s.spacesSlice[j].Name)
}
// Less reports whether the element with index i
@@ -43,7 +43,7 @@ func (s spacesByLastModifiedDateTime) Less(i, j int) bool {
return false
}
// fallback to name if no dateTime is set on both items
return strings.ToLower(*s.spacesSlice[i].Name) < strings.ToLower(*s.spacesSlice[j].Name)
return strings.ToLower(s.spacesSlice[i].Name) < strings.ToLower(s.spacesSlice[j].Name)
}
type userSlice []*libregraph.User
+1 -1
View File
@@ -33,7 +33,7 @@ func (g Graph) ChangeOwnPassword(w http.ResponseWriter, r *http.Request) {
errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, err.Error())
return
}
cpw := libregraph.NewPasswordChange()
cpw := libregraph.NewPasswordChangeWithDefaults()
err = json.NewDecoder(r.Body).Decode(cpw)
if err != nil {
errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, err.Error())