* @param {string} name * @param {number} storageId * @param {string|null} [parentDirectoryId] * @returns {Promise }
(name, storageId, parentDirectoryId)
| 65 | * @returns {Promise<number>} |
| 66 | */ |
| 67 | async function addFile(name, storageId, parentDirectoryId) { |
| 68 | const {data: fileData} = await performApiRequest('/files', { |
| 69 | method: 'POST', |
| 70 | payload: { |
| 71 | name, |
| 72 | storageId, |
| 73 | directoryId: parentDirectoryId, |
| 74 | }, |
| 75 | }); |
| 76 | return fileData.id; |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * @returns {Promise<Record<string, any>[]>} |
no test coverage detected