Skip to content

Commit 471e7f3

Browse files
committed
feat: Add access stats, fix bugs from change in api
1 parent 477d71d commit 471e7f3

5 files changed

Lines changed: 21 additions & 15 deletions

File tree

src/App.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
};
2525
2626
onMounted(() => {
27+
XylobyteAPI.logAccess();
28+
2729
setTimeout(() => {
2830
//console.clear();
2931
console.log('Bienvenue sur la console dev de');

src/api/XylobyteAPI.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@ import axios from 'axios';
55

66
export class XylobyteAPI {
77
static getHardSkills = async (): Promise<HardSkills> =>
8-
await fetchData('https://api.xylobyte.com/v1/website/hardskills');
8+
await fetchData('http://127.0.0.1:3000/v1/website/hardskills');
99

1010
static getSoftSkills = async (): Promise<SoftSkill[]> =>
11-
await fetchData('https://api.xylobyte.com/v1/website/softskills');
11+
await fetchData('http://127.0.0.1:3000/v1/website/softskills');
1212

1313
static getLanguagesSkills = async (): Promise<LanguageSkill[]> =>
14-
await fetchData('https://api.xylobyte.com/v1/website/languages-skills');
14+
await fetchData('http://127.0.0.1:3000/v1/website/languages-skills');
1515

16-
static getProjects = async (): Promise<Project[]> =>
17-
await fetchData('https://api.xylobyte.com/v1/website/projects');
16+
static getProjects = async (): Promise<Project[]> => await fetchData('http://127.0.0.1:3000/v1/website/projects');
1817

1918
static sendContactRequest = async (data: ContactRequestData) => {
20-
const response = await fetch('https://api.xylobyte.com/v1/website/contact', {
19+
const response = await fetch('http://127.0.0.1:3000/v1/website/contact', {
2120
body: JSON.stringify(data),
2221
method: 'POST',
2322
cache: 'no-cache',
@@ -37,7 +36,11 @@ export class XylobyteAPI {
3736
};
3837

3938
static getTexts = async (lang: string): Promise<XylobyteText[]> =>
40-
await fetchData(`https://api.xylobyte.com/v1/website/texts?lang=${lang}`);
39+
await fetchData(`http://127.0.0.1:3000/v1/website/texts?lang=${lang}`);
40+
41+
static logAccess = async () => {
42+
await axios.post('http://127.0.0.1:3000/v1/admin/access-stats/portfolio');
43+
};
4144
}
4245

4346
const fetchData = async (url: string) => {

src/api/skills.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface Project {
2525
from: { year: number; month: number };
2626
to?: { year: number; month: number };
2727
};
28-
skills: { name: string }[];
28+
skills: string[];
2929
featured?: boolean;
3030
type?: 'perso' | 'pro' | 'school';
3131
}

src/components/ProjectCardComponent.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@
6666
<section v-if="!props.isOpen" class="skills flex row gap5 wrap">
6767
<SkillItemComponent
6868
v-for="skill in props.project.skills.slice(0, 3)"
69-
:key="skill.name"
70-
:text="skill.name"
69+
:key="skill"
70+
:text="skill"
7171
type="hard"
7272
/>
7373
</section>
@@ -170,8 +170,8 @@
170170
v-for="skill in props.isOpen
171171
? props.project.skills
172172
: props.project.skills.slice(0, 3)"
173-
:key="skill.name"
174-
:text="skill.name"
173+
:key="skill"
174+
:text="skill"
175175
type="hard"
176176
/>
177177
</section>

src/components/ScrollToTopComponent.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script setup lang="ts">
1+
<script lang="ts" setup>
22
import { useScroll } from '@vueuse/core';
33
import { ArrowUpToLine } from 'lucide-vue-next';
44
@@ -7,11 +7,11 @@
77

88
<template>
99
<div :class="{ top: y < 500 }" class="scroll-top flex a-center j-center transition-all only-desktop" @click="y = 0">
10-
<ArrowUpToLine class="transition-transform" :size="25" />
10+
<ArrowUpToLine :size="25" class="transition-transform" />
1111
</div>
1212
</template>
1313

14-
<style scoped lang="scss">
14+
<style lang="scss" scoped>
1515
.scroll-top {
1616
position: fixed;
1717
bottom: 20px;
@@ -22,6 +22,7 @@
2222
background-color: var(--light-primary-color);
2323
padding: 10px 16px;
2424
border-radius: var(--small-border-radius);
25+
z-index: 2;
2526
2627
&.top {
2728
opacity: 0.2;

0 commit comments

Comments
 (0)