fix user login page display
This commit is contained in:
parent
de52c5e6be
commit
009752ff32
3 changed files with 15 additions and 8 deletions
|
|
@ -1,10 +1,14 @@
|
|||
import { defineStore, storeToRefs } from "pinia";
|
||||
import { ref, computed } from "vue";
|
||||
import { useProjectsStore } from "./projects";
|
||||
import { defineStore, storeToRefs } from 'pinia';
|
||||
import { ref, computed } from 'vue';
|
||||
import { useProjectsStore } from './projects';
|
||||
|
||||
export const useUserStore = defineStore("user", () => {
|
||||
export const useUserStore = defineStore('user', () => {
|
||||
const user = ref(null);
|
||||
|
||||
const isLogged = computed(() => {
|
||||
return user.value?.hasOwnProperty('role');
|
||||
});
|
||||
|
||||
const { projects } = storeToRefs(useProjectsStore());
|
||||
|
||||
const notifications = computed(() => {
|
||||
|
|
@ -22,7 +26,7 @@ export const useUserStore = defineStore("user", () => {
|
|||
});
|
||||
|
||||
function readNotification(notificationId, projectId) {
|
||||
console.log("Read notification", notificationId, projectId);
|
||||
console.log('Read notification', notificationId, projectId);
|
||||
projects.value = projects.value.map((project) => ({
|
||||
...project,
|
||||
notifications:
|
||||
|
|
@ -57,6 +61,7 @@ export const useUserStore = defineStore("user", () => {
|
|||
|
||||
return {
|
||||
user,
|
||||
isLogged,
|
||||
notifications,
|
||||
readNotification,
|
||||
readAllNotifications,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue