Fix the profilepicture url issue (it wasn't sent to the db)

add a prototype of a more generic uploadfile function in uploads.js

makes the distinction between a master cursus and a bachelor cursus in display
This commit is contained in:
2024-03-29 10:55:59 +01:00
parent 94f12f0a86
commit a3c9d6a7c0
6 changed files with 46 additions and 14 deletions

View File

@ -7,5 +7,17 @@ import { restPostFile } from '@/rest/restConsumer.js'
export async function uploadProfilePicture(file){
const formData = new FormData();
formData.append("file", file[0]);
return restPostFile("/upload/ProfilePicture", formData)
return restPostFile("/upload/ProfilePicture", formData);
}
/**
* More generic version of the upload method
*/
export async function uploadFile(file, type){
const formData = new FormData();
formData.append("file", file[0]);
return restPostFile("/upload/"+type, formData)
}