Added stash GraphQL mutations. Added movies to GraphQL queries. Moved key management to profile page, only for approved users.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { render } from 'vike/abort'; /* eslint-disable-line import/extensions */
|
||||
|
||||
import { fetchUser } from '#/src/users.js';
|
||||
import { fetchUserKeys } from '#/src/auth.js';
|
||||
import { fetchUserStashes } from '#/src/stashes.js';
|
||||
import { fetchAlerts } from '#/src/alerts.js';
|
||||
import { fetchSceneRevisions } from '#/src/scenes.js';
|
||||
@@ -29,12 +30,15 @@ async function fetchRevisions(pageContext) {
|
||||
}
|
||||
|
||||
export async function onBeforeRender(pageContext) {
|
||||
const [profile, alerts, userRevisions] = await Promise.all([
|
||||
const [profile, alerts, userRevisions, keys] = await Promise.all([
|
||||
fetchUser(pageContext.routeParams.username, {}, pageContext.user),
|
||||
pageContext.routeParams.section === 'alerts' && pageContext.routeParams.username === pageContext.user?.username
|
||||
? fetchAlerts(pageContext.user)
|
||||
: [],
|
||||
fetchRevisions(pageContext),
|
||||
pageContext.routeParams.section === 'api'
|
||||
? fetchUserKeys(pageContext.user)
|
||||
: [],
|
||||
]);
|
||||
|
||||
if (!profile) {
|
||||
@@ -49,8 +53,6 @@ export async function onBeforeRender(pageContext) {
|
||||
avatars,
|
||||
} = userRevisions;
|
||||
|
||||
console.log(userRevisions);
|
||||
|
||||
const stashes = await fetchUserStashes(profile.id, pageContext.user);
|
||||
|
||||
return {
|
||||
@@ -61,6 +63,7 @@ export async function onBeforeRender(pageContext) {
|
||||
stashes,
|
||||
alerts,
|
||||
revisions,
|
||||
keys,
|
||||
actors,
|
||||
tags,
|
||||
movies,
|
||||
|
||||
Reference in New Issue
Block a user