Skip to content

Commit

Permalink
fix: use router.push on assistant create
Browse files Browse the repository at this point in the history
Signed-off-by: tylerslaton <[email protected]>
  • Loading branch information
tylerslaton committed Sep 4, 2024
1 parent 1df3273 commit 23187c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/scripts/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import React from 'react';
import { Button } from '@nextui-org/react';
import { GoPersonAdd } from 'react-icons/go';
import { createDefaultAssistant } from '@/actions/me/scripts';
import { useRouter } from 'next/navigation';

export default function Create() {
const [loading, setLoading] = React.useState(false);
const router = useRouter();

const handleSubmit = async () => {
createDefaultAssistant().then((script) => {
window.location.href = `/edit?id=${script?.id}`;
router.push(`/edit?id=${script?.id}`);
});
};

Expand Down

0 comments on commit 23187c8

Please sign in to comment.