Skip to content

Commit

Permalink
Hide projects ModelTable and create form in root folder
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Mar 25, 2024
1 parent 4479999 commit c39419d
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { BASE_API_URL, ISO_8601_REGEX } from '$lib/utils/constants';
import { getModelInfo, processObject, type ModelMapEntry, URL_MODEL_MAP } from '$lib/utils/crud';
import { BASE_API_URL } from '$lib/utils/constants';
import { URL_MODEL_MAP, getModelInfo, type ModelMapEntry } from '$lib/utils/crud';
import { tableSourceMapper, type TableSource } from '@skeletonlabs/skeleton';

import { modelSchema } from '$lib/utils/schemas';
import { listViewFields } from '$lib/utils/table';
import type { urlModel } from '$lib/utils/types';
import type { SuperValidated } from 'sveltekit-superforms';
import { superValidate } from 'sveltekit-superforms/server';
import { z, type AnyZodObject } from 'zod';
import type { LayoutServerLoad } from './$types';
import type { SuperValidated } from 'sveltekit-superforms';
import type { urlModel } from '$lib/utils/types';

export const load: LayoutServerLoad = async ({ fetch, params }) => {
const endpoint = `${BASE_API_URL}/${params.model}/${params.id}/`;
Expand All @@ -33,7 +33,10 @@ export const load: LayoutServerLoad = async ({ fetch, params }) => {
const model = getModelInfo(params.model);
const relatedModels = {} as RelatedModels;

if (model.reverseForeignKeyFields) {
if (
model.reverseForeignKeyFields &&
!(model.urlModel === 'folders' && data.content_type === 'GLOBAL')
) {
const initialData = {};
await Promise.all(
model.reverseForeignKeyFields.map(async (e) => {
Expand Down

0 comments on commit c39419d

Please sign in to comment.