chore: API Consistency (#1304)
* chore: Addressing API inconsistencies * lint * add: Missing sort to groups.list fix: Documention issues * test: fix * feat: Add missing shares.info endpoint * feat: Add sorting to users.list endpoint * fix: Incorrect pagination parameters listed on user endpoints * users.s3Upload -> attachments.create * chore: exportAll -> export_all
This commit is contained in:
@ -13,7 +13,7 @@ export const uploadFile = async (
|
||||
options?: Options = { name: '' }
|
||||
) => {
|
||||
const name = file instanceof File ? file.name : options.name;
|
||||
const response = await client.post('/users.s3Upload', {
|
||||
const response = await client.post('/attachments.create', {
|
||||
public: options.public,
|
||||
documentId: options.documentId,
|
||||
contentType: file.type,
|
||||
@ -24,7 +24,7 @@ export const uploadFile = async (
|
||||
invariant(response, 'Response should be available');
|
||||
|
||||
const data = response.data;
|
||||
const asset = data.asset;
|
||||
const attachment = data.attachment;
|
||||
const formData = new FormData();
|
||||
|
||||
for (const key in data.form) {
|
||||
@ -44,7 +44,7 @@ export const uploadFile = async (
|
||||
body: formData,
|
||||
});
|
||||
|
||||
return asset;
|
||||
return attachment;
|
||||
};
|
||||
|
||||
export const dataUrlToBlob = (dataURL: string) => {
|
||||
|
Reference in New Issue
Block a user