mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-28 11:54:42 +00:00
feat(share): record and display share activity (#549)
* feat(share): record and display share activity * style(share): remove activity entry borders * docs(share): explain share link activity
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { client } from './client'
|
||||
|
||||
export function requestShareDownload(
|
||||
shareId: string,
|
||||
fileId: string,
|
||||
key: string,
|
||||
purpose?: 'download' | 'prepare' | 'clipboard',
|
||||
) {
|
||||
const password = localStorage.getItem(`share_pwd_${shareId}`)
|
||||
const postDownload = client.api.shares[':shareId'].files[':fileId']['download-url'].$post
|
||||
const input = { param: { shareId, fileId }, json: { key, purpose } }
|
||||
return password
|
||||
? postDownload(input, { headers: { 'x-share-password': password } })
|
||||
: postDownload(input)
|
||||
}
|
||||
Reference in New Issue
Block a user