mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
refactor: remove empty parent awaits
This commit is contained in:
1 parent
668424a1cf
commit
16843f3ded
38 files changed
+4
-48
No files matched your search
@@ -6,7 +6,6 @@ import { error } from '@sveltejs/kit';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, parent, depends }) => {
|
||||
await parent();
|
||||
depends(Dependencies.ORGANIZATION);
|
||||
|
||||
try {
|
||||
|
||||
@@ -5,7 +5,6 @@ import { Query } from '@aw-labs/appwrite-console';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@ import Header from './header.svelte';
|
||||
import type { LayoutLoad } from './$types';
|
||||
|
||||
export const load: LayoutLoad = async ({ parent }) => {
|
||||
await parent();
|
||||
|
||||
return {
|
||||
header: Header,
|
||||
breadcrumbs: Breadcrumbs
|
||||
|
||||
@@ -5,7 +5,6 @@ import { PAGE_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent, url }) => {
|
||||
await parent();
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
const search = url.search.slice(1) ?? undefined;
|
||||
|
||||
@@ -5,7 +5,6 @@ import { PAGE_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent, url }) => {
|
||||
await parent();
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
const search = url.search.slice(1) ?? undefined;
|
||||
|
||||
@@ -6,7 +6,6 @@ import { Dependencies } from '$lib/constants';
|
||||
import { error } from '@sveltejs/kit';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, parent, depends }) => {
|
||||
await parent();
|
||||
depends(Dependencies.TEAM);
|
||||
try {
|
||||
return {
|
||||
|
||||
@@ -5,7 +5,6 @@ import { PAGE_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import { Dependencies, PAGE_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent, depends, url }) => {
|
||||
await parent();
|
||||
depends(Dependencies.MEMBERSHIPS);
|
||||
const teamId = params.team;
|
||||
const page = Number(params.page);
|
||||
|
||||
@@ -3,7 +3,6 @@ import { sdkForProject } from '$lib/stores/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
const { period } = params;
|
||||
const response = await sdkForProject.users.getUsage(period ?? '30d');
|
||||
return {
|
||||
|
||||
@@ -6,7 +6,6 @@ import { Dependencies } from '$lib/constants';
|
||||
import { error } from '@sveltejs/kit';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, parent, depends }) => {
|
||||
await parent();
|
||||
depends(Dependencies.USER);
|
||||
|
||||
try {
|
||||
|
||||
@@ -5,7 +5,6 @@ import { PAGE_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@ import { sdkForProject } from '$lib/stores/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
|
||||
return {
|
||||
memberships: await sdkForProject.users.listMemberships(params.user)
|
||||
};
|
||||
|
||||
@@ -4,8 +4,6 @@ import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent, depends }) => {
|
||||
depends(Dependencies.SESSIONS);
|
||||
await parent();
|
||||
|
||||
return {
|
||||
sessions: await sdkForProject.users.listSessions(params.user)
|
||||
};
|
||||
|
||||
@@ -3,8 +3,6 @@ import Header from './header.svelte';
|
||||
import type { LayoutLoad } from './$types';
|
||||
|
||||
export const load: LayoutLoad = async ({ parent }) => {
|
||||
await parent();
|
||||
|
||||
return {
|
||||
header: Header,
|
||||
breadcrumbs: Breadcrumbs
|
||||
|
||||
@@ -5,7 +5,6 @@ import { CARD_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, CARD_LIMIT);
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import Header from './header.svelte';
|
||||
import { error } from '@sveltejs/kit';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, parent, depends }) => {
|
||||
await parent();
|
||||
depends(Dependencies.DATABASE);
|
||||
|
||||
try {
|
||||
|
||||
@@ -5,7 +5,6 @@ import { CARD_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, CARD_LIMIT);
|
||||
|
||||
|
||||
-2
@@ -7,8 +7,6 @@ import { error } from '@sveltejs/kit';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, parent, depends }) => {
|
||||
depends(Dependencies.COLLECTION);
|
||||
await parent();
|
||||
|
||||
try {
|
||||
return {
|
||||
header: Header,
|
||||
|
||||
+4
-5
@@ -1,11 +1,10 @@
|
||||
import { Query } from '@aw-labs/appwrite-console';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { Dependencies, PAGE_LIMIT } from '$lib/constants';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { Query } from '@aw-labs/appwrite-console';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent, depends }) => {
|
||||
await parent();
|
||||
export const load: PageLoad = async ({ params, depends }) => {
|
||||
depends(Dependencies.DOCUMENTS);
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
|
||||
-1
@@ -5,7 +5,6 @@ import { PAGE_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
|
||||
|
||||
-1
@@ -5,7 +5,6 @@ import { PAGE_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
|
||||
|
||||
-1
@@ -3,7 +3,6 @@ import { sdkForProject } from '$lib/stores/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
const response = await sdkForProject.databases.getCollectionUsage(
|
||||
params.database,
|
||||
params.collection,
|
||||
|
||||
-1
@@ -3,7 +3,6 @@ import { sdkForProject } from '$lib/stores/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
const response = await sdkForProject.databases.getDatabaseUsage(
|
||||
params.database,
|
||||
params.period ?? '30d'
|
||||
|
||||
@@ -3,7 +3,6 @@ import { sdkForProject } from '$lib/stores/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
const { period } = params;
|
||||
const response = await sdkForProject.databases.getUsage(period ?? '30d');
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@ import Header from './header.svelte';
|
||||
import type { LayoutLoad } from './$types';
|
||||
|
||||
export const load: LayoutLoad = async ({ parent }) => {
|
||||
await parent();
|
||||
|
||||
return {
|
||||
header: Header,
|
||||
breadcrumbs: Breadcrumbs
|
||||
|
||||
@@ -5,7 +5,6 @@ import { CARD_LIMIT, Dependencies } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent, depends }) => {
|
||||
await parent();
|
||||
depends(Dependencies.FUNCTIONS);
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, CARD_LIMIT);
|
||||
|
||||
@@ -6,7 +6,6 @@ import Header from './header.svelte';
|
||||
import { error } from '@sveltejs/kit';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, parent, depends }) => {
|
||||
await parent();
|
||||
depends(Dependencies.FUNCTION);
|
||||
|
||||
try {
|
||||
|
||||
@@ -6,7 +6,6 @@ import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent, depends }) => {
|
||||
depends(Dependencies.DEPLOYMENTS);
|
||||
await parent();
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
|
||||
|
||||
-1
@@ -5,7 +5,6 @@ import { Dependencies, PAGE_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent, depends }) => {
|
||||
await parent();
|
||||
depends(Dependencies.EXECUTIONS);
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
|
||||
@@ -3,7 +3,6 @@ import { Dependencies } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent, depends }) => {
|
||||
await parent();
|
||||
depends(Dependencies.VARIABLES);
|
||||
|
||||
return {
|
||||
|
||||
-1
@@ -3,7 +3,6 @@ import { sdkForProject } from '$lib/stores/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
const response = await sdkForProject.functions.getFunctionUsage(
|
||||
params.function,
|
||||
params.period ?? '30d'
|
||||
|
||||
@@ -3,7 +3,6 @@ import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent, depends }) => {
|
||||
await parent();
|
||||
depends(Dependencies.DOMAINS);
|
||||
|
||||
return {
|
||||
|
||||
@@ -5,7 +5,6 @@ import { CARD_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, CARD_LIMIT);
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import { Dependencies } from '$lib/constants';
|
||||
import { error } from '@sveltejs/kit';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, parent, depends }) => {
|
||||
await parent();
|
||||
depends(Dependencies.BUCKET);
|
||||
|
||||
try {
|
||||
|
||||
@@ -5,7 +5,6 @@ import { Dependencies, PAGE_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent, depends, url }) => {
|
||||
await parent();
|
||||
depends(Dependencies.FILES);
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
|
||||
@@ -6,7 +6,6 @@ import type { LayoutLoad } from './$types';
|
||||
import { error } from '@sveltejs/kit';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, parent, depends }) => {
|
||||
await parent();
|
||||
depends(Dependencies.FILE);
|
||||
|
||||
try {
|
||||
|
||||
@@ -3,7 +3,6 @@ import type { Models } from '@aw-labs/appwrite-console';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
const response = await sdkForProject.storage.getBucketUsage(
|
||||
params.bucket,
|
||||
params.period ?? '30d'
|
||||
|
||||
@@ -3,7 +3,6 @@ import { sdkForProject } from '$lib/stores/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params, parent }) => {
|
||||
await parent();
|
||||
const response = await sdkForProject.storage.getUsage(params.period ?? '30d');
|
||||
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user