Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request nextcloud#43318 from nextcloud/fix/ownerid-string
Browse files Browse the repository at this point in the history
fix(files): dav owner and mime types
  • Loading branch information
skjnldsv authored Feb 5, 2024
2 parents a026048 + 77f307b commit d7dc0f3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
9 changes: 7 additions & 2 deletions apps/files/src/services/Files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions dist/files-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-init.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/systemtags-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/systemtags-init.js.map

Large diffs are not rendered by default.

0 comments on commit d7dc0f3

Please sign in to comment.