Skip to content
Snippets Groups Projects
Commit 78ffa651 authored by Ingrid Martinsheimen Egge's avatar Ingrid Martinsheimen Egge :cow2:
Browse files

store

parent 3c896e5c
No related branches found
No related tags found
1 merge request!21Merge profilinnstillinger into main
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
<Icon icon="material-symbols:person" :color=iconColor :style="{ fontSize: '500px'}" /> <Icon icon="material-symbols:person" :color=iconColor :style="{ fontSize: '500px'}" />
</div> </div>
<h2>{{currentProfile.name}}</h2> <h2>{{profile.name}}</h2>
<button id="changeUserBtn" >Bytt bruker</button> <button id="changeUserBtn" >Bytt bruker</button>
<form @submit.prevent="submit"> <form @submit.prevent="submit">
<label for="brukernavn">Profilnavn</label><br> <label for="brukernavn">Profilnavn</label><br>
<input type="text" required v-model="currentProfile.name"><br> <input type="text" required><br>
<br> <br>
<h4>Brukertype</h4> <h4>Brukertype</h4>
<input type="radio" id="normal" value="false"> <input type="radio" id="normal" value="false">
...@@ -76,7 +76,6 @@ ...@@ -76,7 +76,6 @@
<p class="infoText">OBS: Kontakt admin dersom du ønsker å oppdatere epost</p><br> <p class="infoText">OBS: Kontakt admin dersom du ønsker å oppdatere epost</p><br>
<p>Epost:</p> <p>Epost:</p>
<p>{{userStore.user.email}}</p><br>
<label for="password">Endre passord</label><br> <label for="password">Endre passord</label><br>
<input type="password" id="password" > <input type="password" id="password" >
...@@ -99,29 +98,38 @@ ...@@ -99,29 +98,38 @@
<br><br><br> <br><br><br>
</main> </main>
</template> </template>
<script setup>
<script>
</script>
<script>
import {mapStores} from "pinia";
import {Icon} from "@iconify/vue"; import {Icon} from "@iconify/vue";
import {API} from "@/util/API"; import {API} from "@/util/API";
import {mapState, mapStores} from "pinia"; //import {useAuthStore} from "../stores/authStore";
import { useAuthStore } from "@/stores/authStore"; import { useAuthStore } from "@/stores/authStore";
export default { export default {
name: "ProfileSettings", name: "ProfileSettings",
components: {Icon}, components: {Icon},
setup() { setup() {
const userStore = useAuthStore() //const store = useAuthStore();
return {...mapStores(userStore)} //this.curruser= store.user;
}, },
computed: { computed: {
...mapStores(useAuthStore),
profile() {
const store = useAuthStore();
return store.profile
},
currentUser() { currentUser() {
const store = useAuthStore() //return store.user;
return store.user;
}, },
currentProfile() { currentProfile() {
const store = useAuthStore() //return store.profile;
return store.profile;
}, },
iconColor() { iconColor() {
return "#000000" return "#000000"
...@@ -133,6 +141,7 @@ export default { ...@@ -133,6 +141,7 @@ export default {
}, },
data() { data() {
return { return {
curruser : "",
/*user: { /*user: {
id: "", id: "",
username: "petter@hello.no", username: "petter@hello.no",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment