From f1ee871c026fb9e143b8b543615de5702d7cb807 Mon Sep 17 00:00:00 2001 From: Alex Cabrera Date: Wed, 6 Sep 2023 12:51:17 -0700 Subject: [PATCH] change to id --- backend/zeno_backend/server.py | 6 +++--- .../lib/components/metadata/cells/SliceFinderCell.svelte | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/zeno_backend/server.py b/backend/zeno_backend/server.py index 7d89bc91..3e454266 100644 --- a/backend/zeno_backend/server.py +++ b/backend/zeno_backend/server.py @@ -477,13 +477,13 @@ def add_folder(project: str, name: str): dependencies=[Depends(auth)], ) def add_slice(project: str, req: Slice): - res = insert.slice(project, req) - if res is None: + id = insert.slice(project, req) + if id is None: raise HTTPException( status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail="Failed to insert slice", ) - return res + return id @api_app.post( "/chart/{project}", diff --git a/frontend/src/lib/components/metadata/cells/SliceFinderCell.svelte b/frontend/src/lib/components/metadata/cells/SliceFinderCell.svelte index 13f4000a..277b57a5 100644 --- a/frontend/src/lib/components/metadata/cells/SliceFinderCell.svelte +++ b/frontend/src/lib/components/metadata/cells/SliceFinderCell.svelte @@ -46,7 +46,7 @@ function removeSlice() { ZenoService.deleteSlice(slice).then(() => { invalidateAll(); - slices.update((s) => s.filter((sli) => sli.sliceName !== slice.sliceName)); + slices.update((s) => s.filter((sli) => sli.id !== slice.id)); created = false; }); }