mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-03-01 10:30:40 -06:00
graph: Populate 'ParentRef' in driveitems
This commit is contained in:
committed by
Ralf Haferkamp
parent
f18775b1cb
commit
b0538559c2
@@ -325,6 +325,13 @@ func cs3ResourceToDriveItem(logger *log.Logger, res *storageprovider.ResourceInf
|
||||
lastModified := cs3TimestampToTime(res.Mtime)
|
||||
driveItem.LastModifiedDateTime = &lastModified
|
||||
}
|
||||
if res.ParentId != nil {
|
||||
parentRef := libregraph.NewItemReference()
|
||||
parentRef.SetDriveType(res.Space.SpaceType)
|
||||
parentRef.SetDriveId(storagespace.FormatStorageID(res.ParentId.StorageId, res.ParentId.SpaceId))
|
||||
parentRef.SetId(storagespace.FormatResourceID(*res.ParentId))
|
||||
driveItem.ParentReference = parentRef
|
||||
}
|
||||
if res.Type == storageprovider.ResourceType_RESOURCE_TYPE_FILE && res.MimeType != "" {
|
||||
// We cannot use a libregraph.File here because the openapi codegenerator autodetects 'File' as a go type ...
|
||||
driveItem.File = &libregraph.OpenGraphFile{
|
||||
|
||||
Reference in New Issue
Block a user