Added default PFP; Added PFP upload functionality; Show pfp in Navbar

This commit is contained in:
EisiBaer committed 2023-09-23 16:01:51 +02:00
1 parent fea9a0d0d2
commit 53edb8c7da
19 files changed
+570 -60

No files matched your search

+19 -1
View File
@@ -88,7 +88,7 @@ export default class UserService{
}
);
}
getBoardFromUser( boardId ){
return axios.get(
API_URL + "/user/boards/" + boardId,
@@ -101,4 +101,22 @@ export default class UserService{
);
}
saveNewProfilePicture( pfpFormData ){
return axios.post(
API_URL + "/user/pfp",
pfpFormData,
{
withCredentials: true,
}
);
}
deleteProfilePicture( ){
return axios.delete(
API_URL + "/user/pfp",
{
withCredentials: true,
}
);
}
}
+9
View File
@@ -1,7 +1,10 @@
import { Modal } from "bootstrap";
import BoardEntry from "@/models/BoardEntry";
import Category from "@/models/Category";
import Board from "@/models/Board";
export function boardResponseToBoardModel( boardResponse ){
let categories = [];
@@ -28,4 +31,10 @@ export function boardResponseToBoardModel( boardResponse ){
}
return new Board( boardResponse._id, boardResponse.name, categories );
}
export function openModal( modalId ){
let modalElement = document.getElementById( modalId );
let modalInstance = Modal.getOrCreateInstance( modalElement );
modalInstance.show();
}