diff --git a/pephub/routers/api/v1/namespace.py b/pephub/routers/api/v1/namespace.py index d7976534..bc9b75eb 100644 --- a/pephub/routers/api/v1/namespace.py +++ b/pephub/routers/api/v1/namespace.py @@ -425,6 +425,7 @@ async def remove_from_stars( return JSONResponse( content={ "message": "PEP was removed from favorites.", + "namespace": namespace, "registry": f"{project.namespace}/{project.name}:{project.tag}", }, status_code=202, diff --git a/web/src/api/namespace.ts b/web/src/api/namespace.ts index 968b4388..4214709f 100644 --- a/web/src/api/namespace.ts +++ b/web/src/api/namespace.ts @@ -58,6 +58,18 @@ export interface StarsResponse { results: ProjectAnnotation[]; } +interface AddStarResponse { + namespace: string; + registry_path: string; + message: string; +} + +interface RemoveStarResponse { + message: string; + registry: string; + namespace: string; +} + export const getNamespaceInfo = (namespace: string, token: string | null = null) => { const url = `${API_BASE}/namespaces/${namespace}/`; // note the trailing slash if (!token) { @@ -270,7 +282,7 @@ export const starProject = ( ) => { const url = `${API_BASE}/namespaces/${namespace}/stars`; return axios - .post( + .post( url, { namespace: star_namespace, @@ -298,7 +310,7 @@ export const removeStar = ( ) => { const url = `${API_BASE}/namespaces/${namespace}/stars`; return axios - .delete(url, { + .delete(url, { headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json', diff --git a/web/src/components/forms/blank-project-form.tsx b/web/src/components/forms/blank-project-form.tsx index fa07ebc0..b51252b6 100644 --- a/web/src/components/forms/blank-project-form.tsx +++ b/web/src/components/forms/blank-project-form.tsx @@ -1,5 +1,4 @@ import { ErrorMessage } from '@hookform/error-message'; -import { FC } from 'react'; import { Tab, Tabs } from 'react-bootstrap'; import { Controller, useForm } from 'react-hook-form'; @@ -125,6 +124,7 @@ sample_table: samples.csv Private +