Adds brandingStore.

Split userStore into userProfileStore and creatorProfileStore
This commit is contained in:
2024-09-22 02:42:26 -04:00
parent 3cfb3951e3
commit cd51474d08
36 changed files with 458 additions and 639 deletions

View File

@@ -1,12 +1,12 @@
<script setup>
import { useUserStore } from "@/stores/userStore.js";
import { REACTIONS } from "@/Constants/Reactions.js";
import { computed, ref } from "vue";
import { useClient } from "@/plugins/api.js";
import {useAuthStore} from "@/stores/authStore.js"
import MustBeLogged from "@/views/MustBeLogged.vue";
import {useUserProfileStore} from "@/stores/userProfileStore.js";
const userStore = useUserStore();
const userProfileStore = useUserProfileStore();
const authStore = useAuthStore()
const props = defineProps({
@@ -49,8 +49,8 @@ async function reactToContent(reaction) {
const request = {
ContentId: contentId.value,
reaction: reaction,
userId: userStore.user.id,
userName: `${userStore.user.firstName} ${userStore.user.lastName}`,
userId: userProfileStore.value.id,
userName: `${userProfileStore.value.firstName} ${userProfileStore.value.lastName}`,
};
adjustReactionCount(reaction);
await client.post("/api/content/reaction/", request);
@@ -61,8 +61,8 @@ async function reactToContent(reaction) {
const requestAdd = {
ContentId: contentId.value,
reaction: reaction,
userId: userStore.user.id,
userName: `${userStore.user.firstName} ${userStore.user.lastName}`,
userId: userProfileStore.value.id,
userName: `${userProfileStore.value.firstName} ${userProfileStore.value.lastName}`,
};
adjustReactionCount(reaction);
await client.post("/api/content/reaction/", requestAdd);
@@ -71,7 +71,7 @@ async function reactToContent(reaction) {
} else {
const requestRemove = {
ContentId: contentId.value,
userId: userStore.user.id,
userId: userProfileStore.value.id,
};
adjustReactionCount(reaction);
await client.post("/api/content/reaction/remove", requestRemove);
@@ -168,7 +168,7 @@ function adjustReactionCount(newReaction) {
}
function initializeReactions() {
const userReaction = props.content.reactions.find((x) => x.userId === userStore.user.id);
const userReaction = props.content.reactions.find((x) => x.userId === userProfileStore.value.id);
if (userReaction) {
currentReaction.value = userReaction.reaction;
hasReacted.value = true;