Completion of APIs except for user progress

This commit is contained in:
HAM!DREZA
2024-06-23 11:23:05 +03:30
parent 607ead8528
commit 46dd3d65a0
17 changed files with 356 additions and 411 deletions
+7 -2
View File
@@ -283,8 +283,8 @@
<nuxt-link to="/account" v-if="authUser">
<img
v-if="authUser.avatarMedia"
:src="authUser?.avatarMedia"
v-if="profileImage"
:src="profileImage"
alt="profile"
class="h-[3.698vw] w-[3.698vw] rounded-full p-[0.521vw]"
/>
@@ -315,6 +315,7 @@
</nuxt-link>
</div>
</nav>
<div
v-if="showSearchBox"
class="z-[10] w-[28vw] pt-[0.5vw] pb-[2vw] flex flex-col absolute mt-[8vw] rounded-[0.521vw] bg-[#F5F5F5] border shadow-md"
@@ -356,11 +357,15 @@
</div>
<!-- <div v-for="item in data.courses" :key="item.id">{{ item.name }}</div> -->
</div>
</div>
</template>
<script setup>
const {data: image} = await useFetch('/api/auth/me')
const profileImage = useState('profileImage', () => image.value?.avatarMedia)
const { authUser } = useAuth();
const showSearchBox = useState("showSearchBox", () => false);
const search = ref(null);
+7 -2
View File
@@ -284,8 +284,9 @@
<p
class="py-[2vw] md:py-0 text-[17.72px] md:text-[1.502vw] text-[#383E43] mt-[0.417vw]"
>
<span v-if="authUser.name">
{{authUser?.name}}
<span v-if="profileName">
{{profileName}}
</span>
<span v-else>کاربر</span>
@@ -341,10 +342,13 @@
</div>
</main>
</div>
</template>
<script setup>
const {data, refresh} = await useFetch('/api/auth/me')
const profileName = useState('profileName', () => data.value.name)
import { useToast } from 'vue-toastification'
const toast = useToast()
const {authUser} = useAuth();
@@ -357,6 +361,7 @@ async function logout(){
toast.warning("از حساب کاربری خود خارج شدید")
return navigateTo('/')
}
</script>
<style>