Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/staging' into small-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Anchel123 committed Feb 5, 2025
2 parents ec639ff + c715c86 commit f36d3cb
Show file tree
Hide file tree
Showing 8 changed files with 187 additions and 258 deletions.
7 changes: 4 additions & 3 deletions app/components/CreateGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export default function CreateGraph({

const handleCreateGraph = async (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault()
if (!graphName) {
const name = graphName.trim()
if (!name) {
toast({
title: "Error",
description: "Graph name cannot be empty",
Expand All @@ -48,13 +49,13 @@ export default function CreateGraph({
return
}
const q = 'RETURN 1'
const result = await securedFetch(`api/graph/${prepareArg(graphName)}/?query=${prepareArg(q)}`, {
const result = await securedFetch(`api/graph/${prepareArg(name)}/?query=${prepareArg(q)}`, {
method: "GET",
}, session?.user?.role, toast)

if (!result.ok) return

onSetGraphName(graphName)
onSetGraphName(name)
setGraphName("")
setOpen(false)
toast({
Expand Down
Loading

0 comments on commit f36d3cb

Please sign in to comment.