feat(doclib): 增加批量设置分享 API 客户端。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
522ef36e7a
commit
92a8b3f6da
2 files changed
+13
No files matched your search
@@ -67,6 +67,11 @@ export const saveDoclibShares = (id: string, userIds: string[]) =>
|
||||
url: `${base}/files/${encodeURIComponent(id)}/shares`,
|
||||
data: { userIds }
|
||||
})
|
||||
export const saveDoclibBatchShares = (ids: string[], userIds: string[]) =>
|
||||
request.post<DoclibDocument[]>({
|
||||
url: `${base}/files/batch-shares`,
|
||||
data: { ids, userIds }
|
||||
})
|
||||
export const deleteDoclibFiles = (ids: string[]) =>
|
||||
request.post({ url: `${base}/files/batch-delete`, data: { ids } })
|
||||
export const downloadDoclibFile = (id: string) =>
|
||||
|
||||
@@ -44,3 +44,11 @@ test('专用上传请求提交原文件及目标目录,清空分享提交空
|
||||
assert.equal(calls[1].method, 'put')
|
||||
assert.deepEqual(calls[1].config.data, { userIds: [] })
|
||||
})
|
||||
|
||||
test('批量分享提交文档 id 列表与人员 id', async () => {
|
||||
const { api, calls } = apiAdapter()
|
||||
await api.saveDoclibBatchShares(['id/a', 'id/b'], ['u1', 'u2'])
|
||||
assert.equal(calls[0].method, 'post')
|
||||
assert.equal(calls[0].config.url, '/web/doclib/files/batch-shares')
|
||||
assert.deepEqual(calls[0].config.data, { ids: ['id/a', 'id/b'], userIds: ['u1', 'u2'] })
|
||||
})
|
||||
Reference in new issue
Block a user