Fixed a Small Error and Updated/Added Tests

This commit is contained in:
Ahmad 2024-12-29 18:50:54 -05:00
parent 4f205d7584
commit 3a095e2096
No known key found for this signature in database
GPG key ID: 8FD8A93530D182BF
9 changed files with 105 additions and 14 deletions

View file

@ -1,7 +1,7 @@
'use client';
import { toast } from 'sonner';
import { useRef, useState } from 'react';
import { useEffect, useRef, useState } from 'react';
import { Board } from '@prisma/client';
import { Button } from '@/components/ui/button';
@ -25,7 +25,11 @@ export const BoardTitleForm = ({ data }: BoardTitleFormProps) => {
},
});
const formRef = useRef<HTMLFormElement>(document.createElement('form'));
const formRef = useRef<HTMLFormElement>(null);
useEffect(() => {
formRef.current = document.createElement('form');
}, []);
const inputRef = useRef<HTMLInputElement>(null);
const [title, setTitle] = useState(data.title);

View file

@ -35,6 +35,7 @@ const BoardIdPage = async (props: BoardIdPageProps) => {
orderBy: {
order: 'asc',
},
cacheStrategy: { ttl: 30, swr: 60 },
});
return (