Update src/app/(main)/settings/websites/WebsiteAddForm.tsx

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
The-Yearly 2025-05-15 16:35:00 +05:30 committed by GitHub
parent 7af402e858
commit 775148592a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,9 +27,9 @@ export function WebsiteAddForm({
const { mutate, error, isPending } = useMutation({
mutationFn: (data: any) => post('/websites', { ...data, teamId }),
onSuccess: data => {
saveDashboard({
websiteActive: [...websiteActive, data.id],
});
saveDashboard(prev => ({
websiteActive: [...(prev.websiteActive || []), data.id],
}));
},
});