Skip to content

Commit

Permalink
add create subject crisp event
Browse files Browse the repository at this point in the history
  • Loading branch information
xvvvyz committed Aug 21, 2023
1 parent 7ce4277 commit 9289842
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/(account)/subjects/_components/subject-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Button from '@/_components/button';
import Input from '@/_components/input';
import useSupabase from '@/_hooks/use-supabase';
import { Database } from '@/_types/database';
import { Crisp as C } from 'crisp-sdk-web';
import { useDropzone } from 'react-dropzone';
import { Controller, useForm } from 'react-hook-form';

Expand Down Expand Up @@ -66,6 +67,13 @@ const SubjectForm = ({ subject }: SubjectFormProps) => {
supabase,
});

if (!subject) {
C.session.pushEvent('subjects:create', {
id: subjectData.id,
name: values.name,
});
}

await redirect(`/subjects/${subjectData.id}/timeline`);
})}
>
Expand Down

0 comments on commit 9289842

Please sign in to comment.