mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-12 18:22:49 +01:00
refactor: remove pocketbase (#1138)
This commit is contained in:
16
ui/src/api.ts
Normal file
16
ui/src/api.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { Configuration, DefaultApi } from '@/client'
|
||||
import { useAuthStore } from '@/store/auth'
|
||||
|
||||
export function useAPI() {
|
||||
const authStore = useAuthStore()
|
||||
return new DefaultApi(
|
||||
new Configuration({
|
||||
basePath: 'http://localhost:8090/api',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Accept: 'application/json',
|
||||
Authorization: `Bearer ${authStore.token}`
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user