Skip to content

Commit

Permalink
fix schema bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nleroy917 committed Jul 25, 2024
1 parent 9a34c76 commit 5ce1de6
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
3 changes: 1 addition & 2 deletions pephub/routers/api/v1/namespace.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import json
import shutil
import tempfile
from typing import List, Literal, Optional, Union
Expand Down Expand Up @@ -204,7 +203,7 @@ async def create_pep(
# create a blank peppy.Project object with fake files
else:
raise HTTPException(
detail=f"Project files were not provided",
detail="Project files were not provided",
status_code=400,
)

Expand Down
2 changes: 1 addition & 1 deletion web/src/api/namespace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,12 @@ export const submitProjectJSON = (
pep_dict: {
config: config_json,
sample_list: sample_table,
pep_schema: pep_schema,
},
description: description || '',
name: name,
is_private: is_private || false,
tag: tag || 'default',
pep_schema: pep_schema,
},
{
headers: {
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/forms/blank-project-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const BlankProjectForm = (props: Props) => {
config: `pep_version: 2.1.0
sample_table: samples.csv
`,
pep_schema: 'pep/2.1.0',
pep_schema: undefined,
},
});

Expand Down
6 changes: 3 additions & 3 deletions web/src/components/forms/project-upload-form.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ErrorMessage } from '@hookform/error-message';
import { FC, useRef } from 'react';
import { useRef } from 'react';
import { Controller, FieldErrors, useForm } from 'react-hook-form';
import toast from 'react-hot-toast';

Expand Down Expand Up @@ -54,7 +54,7 @@ const CombinedErrorMessage = (props: CombinedErrorMessageProps) => {
return null;
};

export const ProjectUploadForm: FC<Props> = ({ onHide, defaultNamespace }) => {
export const ProjectUploadForm = ({ onHide, defaultNamespace }: Props) => {
// get user info
const { user } = useSession();

Expand All @@ -70,7 +70,7 @@ export const ProjectUploadForm: FC<Props> = ({ onHide, defaultNamespace }) => {
mode: 'onChange',
defaultValues: {
is_private: false,
pep_schema: 'databio/pep-2.1.0',
pep_schema: undefined,
namespace: defaultNamespace || user?.login || '',
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const ProjectValidationAndEditButtons = (props: ProjectValidationAndEditB
>
<div className="d-flex align-items-center">
<StatusIcon className="text-2xl" variant="warning" />
<span>Add schema to PEP to validate</span>
<span>No schema</span>
</div>
</OverlayTrigger>
</>
Expand Down
1 change: 1 addition & 0 deletions web/src/hooks/mutations/useBlankProjectFormMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const useBlankProjectFormMutation = (namespace: string) => {
const mutation = useMutation({
mutationFn: (data: NewBlankProject) => {
const { projectName, tag, isPrivate, description, config, pepSchema, sampleTable } = data;
debugger;
return submitProjectJSON(
{
namespace: namespace,
Expand Down

0 comments on commit 5ce1de6

Please sign in to comment.