Backend: Added 'profile_pic' in info database. Frontend: Changed the way the profile picture is loaded.
This commit is contained in:
parent
cb4cfe26cb
commit
06188f1faa
5 changed files with 4 additions and 3 deletions
|
@ -12,5 +12,6 @@ CREATE TABLE public.info (
|
|||
email varchar NULL,
|
||||
softskills text NULL,
|
||||
interests text NULL,
|
||||
profile_pic text NULL,
|
||||
CONSTRAINT info_pkey PRIMARY KEY (id)
|
||||
);
|
|
@ -10,6 +10,7 @@ pub struct Info {
|
|||
pub softskills: Option<String>,
|
||||
pub interests: Option<String>,
|
||||
pub birth_year: Option<NaiveDate>,
|
||||
pub profile_pic: Option<String>
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
|
|
|
@ -60,7 +60,7 @@ macro_rules! _gather_data {
|
|||
async fn info(State(pool): State<PgPool>) -> Json<Vec<Info>> {
|
||||
let datas = sqlx::query_as!(
|
||||
Info,
|
||||
"SELECT id, full_name, phone_number, email, softskills, interests, birth_year FROM public.info"
|
||||
"SELECT id, full_name, phone_number, email, softskills, interests, birth_year, profile_pic FROM public.info"
|
||||
)
|
||||
.fetch_all(&pool)
|
||||
.await.unwrap_or(vec![]);
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 517 KiB |
|
@ -6,7 +6,6 @@
|
|||
import "$lib/css/cv.css";
|
||||
|
||||
// Sidebar
|
||||
import profile_pic from "$lib/img/cvnQU1-W_nowhite_carre.jpg";
|
||||
import SidebarComponent from "$lib/components/sidebar-component.svelte";
|
||||
import {
|
||||
mdiAccount,
|
||||
|
@ -83,7 +82,7 @@
|
|||
<div class="profile-picture-container">
|
||||
<img
|
||||
class="profile-picture"
|
||||
src={profile_pic}
|
||||
src={cv.info.profile_pic}
|
||||
alt={cv.info.full_name}
|
||||
/>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue