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"; | 	import adminPanel from "~/components/profile/adminPanel.vue"; | ||||||
| 
 | 
 | ||||||
| 	const rtr = useRoute(); | 	const rtr = useRoute(); | ||||||
| 	const { data } = useAuth(); | 	const { data: ses } = useAuth(); | ||||||
| 
 | 
 | ||||||
| 	const { data: userInfo } = await useApiFetch<IUser>(`/user/${rtr.params.id}`); | 	const { data: userInfo } = await useApiFetch<IUser>(`/user/${rtr.params.id}`); | ||||||
| 	if (userInfo === null) { | 	if (userInfo === null) { | ||||||
| @ -22,9 +22,9 @@ | |||||||
| 	); | 	); | ||||||
| 
 | 
 | ||||||
| 	const isSelf = userInfo.value?._id === parseInt(rtr.params.id as string); | 	const isSelf = userInfo.value?._id === parseInt(rtr.params.id as string); | ||||||
| 
 | 	useHead({ | ||||||
| 	console.log("rtr", rtr); | 		title: `Viewing profile for ${userInfo.value.username}`, | ||||||
| 	console.log("LVLVLVLVVLV", new Date(uLastVisit)); | 	}); | ||||||
| </script> | </script> | ||||||
| <template> | <template> | ||||||
| 	<a-card style="width: 100%"> | 	<a-card style="width: 100%"> | ||||||
| @ -94,7 +94,7 @@ | |||||||
| 			</a-descriptions-item> | 			</a-descriptions-item> | ||||||
| 			<a-descriptions-item | 			<a-descriptions-item | ||||||
| 				label="Email" | 				label="Email" | ||||||
| 				v-if="userInfo?.profile.showEmail || data?.user?.profile.isAdmin" | 				v-if="userInfo?.profile.showEmail || ses?.user?.profile.isAdmin" | ||||||
| 			> | 			> | ||||||
| 				{{ userInfo?.email }} | 				{{ userInfo?.email }} | ||||||
| 			</a-descriptions-item> | 			</a-descriptions-item> | ||||||
| @ -105,7 +105,7 @@ | |||||||
| 				<div v-html="userInfo?.profile.bio"></div> | 				<div v-html="userInfo?.profile.bio"></div> | ||||||
| 			</a-tab-pane> | 			</a-tab-pane> | ||||||
| 			<a-tab-pane key="stories" tab="Stories"> | 			<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> | ||||||
| 			<a-tab-pane key="favs" tab="Favourites"> | 			<a-tab-pane key="favs" tab="Favourites"> | ||||||
| 				<a-tabs centered v-model:active-key="activeFavKey"> | 				<a-tabs centered v-model:active-key="activeFavKey"> | ||||||
| @ -126,7 +126,7 @@ | |||||||
| 								<!-- {{ item.title }} --> | 								<!-- {{ item.title }} --> | ||||||
| 								<a-row :gutter="[25, 0]" :align="'middle'"> | 								<a-row :gutter="[25, 0]" :align="'middle'"> | ||||||
| 									<a-col :span="23"> | 									<a-col :span="23"> | ||||||
| 										<single-story :story="item" /> | 										<single-story :last="true" :story="item" /> | ||||||
| 									</a-col> | 									</a-col> | ||||||
| 									<a-col :span="1" v-if="isSelf"> | 									<a-col :span="1" v-if="isSelf"> | ||||||
| 										<a | 										<a | ||||||
| @ -192,7 +192,7 @@ | |||||||
| 					</a-tab-pane> | 					</a-tab-pane> | ||||||
| 				</a-tabs> | 				</a-tabs> | ||||||
| 			</a-tab-pane> | 			</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" /> | 				<admin-panel :user="userInfo" /> | ||||||
| 			</a-tab-pane> | 			</a-tab-pane> | ||||||
| 		</a-tabs> | 		</a-tabs> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user