Fix URL bug + Redundant call (#1110)

* Fix URL bug + Redundant call

* Fix prettier
This commit is contained in:
Geometrically
2023-04-21 14:48:23 -07:00
committed by GitHub
parent 5e3da71ce4
commit 5527170fab
4 changed files with 36 additions and 51 deletions

View File

@@ -14,21 +14,18 @@ export const initUser = async () => {
const user = {
notifications: [],
follows: [],
projects: [],
lastUpdated: 0,
}
if (auth.user && auth.user.id) {
try {
const [notifications, follows, projects] = await Promise.all([
const [notifications, follows] = await Promise.all([
useBaseFetch(`user/${auth.user.id}/notifications`, auth.headers),
useBaseFetch(`user/${auth.user.id}/follows`, auth.headers),
useBaseFetch(`user/${auth.user.id}/projects`, auth.headers),
])
user.notifications = notifications
user.follows = follows
user.projects = projects
user.lastUpdated = Date.now()
} catch (err) {
console.error(err)