more work on attachments

* fix frontend env usage
This commit is contained in:
Philipinho
2024-05-22 23:24:57 +01:00
parent b06a78b6ec
commit ccf9d5d99f
31 changed files with 612 additions and 349 deletions

View File

@@ -13,8 +13,10 @@ export async function updateUser(data: Partial<IUser>): Promise<IUser> {
export async function uploadAvatar(file: File) {
const formData = new FormData();
formData.append("avatar", file);
const req = await api.post("/attachments/upload/avatar", formData, {
formData.append("type", "avatar");
formData.append("image", file);
const req = await api.post("/attachments/upload-image", formData, {
headers: {
"Content-Type": "multipart/form-data",
},