Merge pull request #43318 from nextcloud/fix/ownerid-string

fix(files): dav owner and mime types
This commit is contained in:
John Molakvoæ 2024-02-05 16:18:04 +01:00 committed by GitHub
commit d7dc0f3fff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 13 additions and 8 deletions

View file

@ -40,9 +40,14 @@ interface ResponseProps extends DAVResultResponseProps {
}
export const resultToNode = function(node: FileStat): File | Folder {
const userId = getCurrentUser()?.uid
if (!userId) {
throw new Error('No user id found')
}
const props = node.props as ResponseProps
const permissions = davParsePermissions(props?.permissions)
const owner = (props['owner-id'] || getCurrentUser()?.uid) as string
const owner = (props['owner-id'] || userId).toString()
const source = generateRemoteUrl('dav' + rootPath + node.filename)
const id = props?.fileid < 0
@ -53,7 +58,7 @@ export const resultToNode = function(node: FileStat): File | Folder {
id,
source,
mtime: new Date(node.lastmod),
mime: node.mime as string,
mime: node.mime || 'application/octet-stream',
size: props?.size as number || 0,
permissions,
owner,

4
dist/files-init.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long