mirror of
https://github.com/nextcloud/server.git
synced 2026-06-06 23:34:22 -04:00
fix(files): dav owner and mime types
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
This commit is contained in:
parent
a026048050
commit
77f307bafd
5 changed files with 13 additions and 8 deletions
|
|
@ -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
4
dist/files-init.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-init.js.map
vendored
2
dist/files-init.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/systemtags-init.js
vendored
4
dist/systemtags-init.js
vendored
File diff suppressed because one or more lines are too long
2
dist/systemtags-init.js.map
vendored
2
dist/systemtags-init.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue