File tree Expand file tree Collapse file tree 5 files changed +21
-7
lines changed
widgets/ui/page-placeholder Expand file tree Collapse file tree 5 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { useSettings } from "~/src/shared/lib/use-settings";
33// todo: use store for token
44export default defineNuxtPlugin ( async ( ) => {
55 const {
6- api : { getSettings } ,
6+ api,
77 } = useSettings ( ) ;
88
99 let settings = {
@@ -15,7 +15,7 @@ export default defineNuxtPlugin(async () => {
1515 }
1616
1717 try {
18- settings = await getSettings ( )
18+ settings = await api . getSettings ( )
1919 } catch ( e ) {
2020 console . error ( 'Server is not available!' )
2121 }
Original file line number Diff line number Diff line change @@ -17,10 +17,10 @@ type TUseEventsRequests = () => {
1717export const useEventsRequests : TUseEventsRequests = ( ) => {
1818 const app = useNuxtApp ( )
1919 const { token} = app . $authToken
20- const headers = { "X-Auth-Token" : token }
20+ const headers = { "X-Auth-Token" : token || '' }
2121 const getEventRestUrl = ( param ?: string ) : string => `${ REST_API_URL } /api/event${ param ? `/${ param } ` : 's' } `
2222
23- const getAll = ( ) => fetch ( getEventRestUrl ( ) , { headers} )
23+ const getAll = ( ) => fetch ( getEventRestUrl ( ) , { headers } )
2424 . then ( ( response ) => response . json ( ) )
2525 . then ( ( response ) => {
2626 if ( response ?. data ) {
Original file line number Diff line number Diff line change 1+ import { useNuxtApp } from "#app" ; // eslint-disable-line @conarti/feature-sliced/layers-slices
2+ import type { Profile } from "../../types" ;
13import { REST_API_URL } from "../io" ;
24
35
46type TUseSettings = {
57 api : {
68 getVersion : ( ) => Promise < string >
9+ getProfile : ( ) => Promise < Profile >
10+ getSettings : ( ) => Promise < unknown >
711 }
812}
913
@@ -21,7 +25,7 @@ export const useSettings = (): TUseSettings => {
2125 . catch ( ( ) => 'unknown' ) ;
2226
2327 const getProfile = ( ) => fetch ( `${ REST_API_URL } /api/me` , {
24- headers : { "X-Auth-Token" : nuxtApp . $authToken . token }
28+ headers : { "X-Auth-Token" : nuxtApp . $authToken . token || "" }
2529 } )
2630 . then ( ( response ) => response . json ( ) )
2731 . catch ( ( ) => 'unknown' ) ;
Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ const items = [
2828 :key =" item.title"
2929 :icon-name =" item.iconName"
3030 :title =" item.title"
31- :link-name =" item.linkName"
3231 :link-url =" item.linkUrl"
3332 />
3433 </ul >
Original file line number Diff line number Diff line change 11{
2- "extends" : " ./.nuxt/tsconfig.json"
2+ "extends" : " ./.nuxt/tsconfig.json" ,
3+ "include" : [
4+ " src/**/*.vue" ,
5+ " .nuxt/nuxt.d.ts" ,
6+ " .nuxt/.config/nuxt.*" ,
7+ " .nuxt/**/*" ,
8+ " .nuxt/node_modules/@nuxtjs/tailwindcss/runtime" ,
9+ " .nuxt/node_modules/@pinia/nuxt/runtime" ,
10+ " .nuxt/node_modules/@nuxt/devtools/runtime" ,
11+ " .nuxt/node_modules/@nuxt/telemetry/runtime" ,
12+ " .nuxt"
13+ ]
314}
You can’t perform that action at this time.
0 commit comments