Update packages and refactored code for improved performance
Updated versions of various packages including "@tanstack/react-query", "@typescript-eslint/eslint-plugin", "@typescript-eslint/parser", and "@marsidev/react-turnstile". Additionally, refactored the code in several files including package.json, members-page.loader.ts, page.tsx to ensure proper import statements and optimal function execution order.
This commit is contained in:
@@ -2,10 +2,9 @@ import 'server-only';
|
||||
|
||||
import { SupabaseClient } from '@supabase/supabase-js';
|
||||
|
||||
import { loadTeamWorkspace } from '~/home/[account]/_lib/server/team-account-workspace.loader';
|
||||
import { Database } from '~/lib/database.types';
|
||||
|
||||
import { loadTeamWorkspace } from '../../../_lib/server/team-account-workspace.loader';
|
||||
|
||||
/**
|
||||
* Load data for the members page
|
||||
* @param client
|
||||
@@ -16,10 +15,10 @@ export async function loadMembersPageData(
|
||||
slug: string,
|
||||
) {
|
||||
return Promise.all([
|
||||
loadTeamWorkspace(slug),
|
||||
loadAccountMembers(client, slug),
|
||||
loadInvitations(client, slug),
|
||||
canAddMember,
|
||||
loadTeamWorkspace(slug),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ import { If } from '@kit/ui/if';
|
||||
import { PageBody } from '@kit/ui/page';
|
||||
import { Trans } from '@kit/ui/trans';
|
||||
|
||||
import { loadTeamWorkspace } from '~/home/[account]/_lib/server/team-account-workspace.loader';
|
||||
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
|
||||
@@ -44,9 +43,7 @@ export const generateMetadata = async () => {
|
||||
async function TeamAccountMembersPage({ params }: Params) {
|
||||
const client = getSupabaseServerComponentClient();
|
||||
|
||||
const { user } = await loadTeamWorkspace(params.account);
|
||||
|
||||
const [{ account }, members, invitations, canAddMember] =
|
||||
const [members, invitations, canAddMember, { user, account }] =
|
||||
await loadMembersPageData(client, params.account);
|
||||
|
||||
const canManageRoles = account.permissions.includes('roles.manage');
|
||||
|
||||
Reference in New Issue
Block a user