refactor(pages): rename session data variable in setup script
i want to make sure only super duper important variables are named "data".
This commit is contained in:
		
							parent
							
								
									96a0d36bef
								
							
						
					
					
						commit
						25a68b1f3e
					
				| @ -8,7 +8,7 @@ | ||||
| 	import adminPanel from "~/components/profile/adminPanel.vue"; | ||||
| 
 | ||||
| 	const rtr = useRoute(); | ||||
| 	const { data } = useAuth(); | ||||
| 	const { data: ses } = useAuth(); | ||||
| 
 | ||||
| 	const { data: userInfo } = await useApiFetch<IUser>(`/user/${rtr.params.id}`); | ||||
| 	if (userInfo === null) { | ||||
| @ -22,9 +22,9 @@ | ||||
| 	); | ||||
| 
 | ||||
| 	const isSelf = userInfo.value?._id === parseInt(rtr.params.id as string); | ||||
| 
 | ||||
| 	console.log("rtr", rtr); | ||||
| 	console.log("LVLVLVLVVLV", new Date(uLastVisit)); | ||||
| 	useHead({ | ||||
| 		title: `Viewing profile for ${userInfo.value.username}`, | ||||
| 	}); | ||||
| </script> | ||||
| <template> | ||||
| 	<a-card style="width: 100%"> | ||||
| @ -94,7 +94,7 @@ | ||||
| 			</a-descriptions-item> | ||||
| 			<a-descriptions-item | ||||
| 				label="Email" | ||||
| 				v-if="userInfo?.profile.showEmail || data?.user?.profile.isAdmin" | ||||
| 				v-if="userInfo?.profile.showEmail || ses?.user?.profile.isAdmin" | ||||
| 			> | ||||
| 				{{ userInfo?.email }} | ||||
| 			</a-descriptions-item> | ||||
| @ -105,7 +105,7 @@ | ||||
| 				<div v-html="userInfo?.profile.bio"></div> | ||||
| 			</a-tab-pane> | ||||
| 			<a-tab-pane key="stories" tab="Stories"> | ||||
| 				<listings-stories :prefix="`/user/${$route.params.id}/stories`" /> | ||||
| 				<listings-stories :prefix="`/user/${rtr.params.id}/stories`" /> | ||||
| 			</a-tab-pane> | ||||
| 			<a-tab-pane key="favs" tab="Favourites"> | ||||
| 				<a-tabs centered v-model:active-key="activeFavKey"> | ||||
| @ -126,7 +126,7 @@ | ||||
| 								<!-- {{ item.title }} --> | ||||
| 								<a-row :gutter="[25, 0]" :align="'middle'"> | ||||
| 									<a-col :span="23"> | ||||
| 										<single-story :story="item" /> | ||||
| 										<single-story :last="true" :story="item" /> | ||||
| 									</a-col> | ||||
| 									<a-col :span="1" v-if="isSelf"> | ||||
| 										<a | ||||
| @ -192,7 +192,7 @@ | ||||
| 					</a-tab-pane> | ||||
| 				</a-tabs> | ||||
| 			</a-tab-pane> | ||||
| 			<a-tab-pane key="admin" tab="Admin" v-if="data?.user?.profile.isAdmin"> | ||||
| 			<a-tab-pane key="admin" tab="Admin" v-if="ses?.user?.profile.isAdmin"> | ||||
| 				<admin-panel :user="userInfo" /> | ||||
| 			</a-tab-pane> | ||||
| 		</a-tabs> | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user