fix: 🐛 Tiny bugs (Sentry)
This commit is contained in:
@@ -83,15 +83,17 @@ export const CredentialsDropdown = ({
|
||||
router.push(router.asPath.split('?')[0], undefined, { shallow: true })
|
||||
}
|
||||
|
||||
const handleDeleteDomainClick = (credentialsId: string) => async () => {
|
||||
if (!user?.id) return
|
||||
setIsDeleting(credentialsId)
|
||||
const { error } = await deleteCredentials(user?.id, credentialsId)
|
||||
setIsDeleting(undefined)
|
||||
if (error) return toast({ title: error.name, description: error.message })
|
||||
onCredentialsSelect(undefined)
|
||||
mutate({ credentials: credentials.filter((c) => c.id !== credentialsId) })
|
||||
}
|
||||
const handleDeleteDomainClick =
|
||||
(credentialsId: string) => async (e: React.MouseEvent) => {
|
||||
e.stopPropagation()
|
||||
if (!user?.id) return
|
||||
setIsDeleting(credentialsId)
|
||||
const { error } = await deleteCredentials(user?.id, credentialsId)
|
||||
setIsDeleting(undefined)
|
||||
if (error) return toast({ title: error.name, description: error.message })
|
||||
onCredentialsSelect(undefined)
|
||||
mutate({ credentials: credentials.filter((c) => c.id !== credentialsId) })
|
||||
}
|
||||
|
||||
return (
|
||||
<Menu isLazy placement="bottom-end" matchWidth>
|
||||
@@ -121,7 +123,7 @@ export const CredentialsDropdown = ({
|
||||
</MenuItem>
|
||||
)}
|
||||
{credentialsList.map((credentials) => (
|
||||
<Button
|
||||
<MenuItem
|
||||
role="menuitem"
|
||||
minH="40px"
|
||||
key={credentials.id}
|
||||
@@ -129,8 +131,6 @@ export const CredentialsDropdown = ({
|
||||
fontSize="16px"
|
||||
fontWeight="normal"
|
||||
rounded="none"
|
||||
colorScheme="gray"
|
||||
variant="ghost"
|
||||
justifyContent="space-between"
|
||||
>
|
||||
{credentials.name}
|
||||
@@ -141,7 +141,7 @@ export const CredentialsDropdown = ({
|
||||
onClick={handleDeleteDomainClick(credentials.id)}
|
||||
isLoading={isDeleting === credentials.id}
|
||||
/>
|
||||
</Button>
|
||||
</MenuItem>
|
||||
))}
|
||||
<MenuItem
|
||||
maxW="500px"
|
||||
|
||||
@@ -89,6 +89,7 @@ export const deleteEdgeDraft = (
|
||||
edgeId: string
|
||||
) => {
|
||||
const edgeIndex = typebot.edges.findIndex(byId(edgeId))
|
||||
if (edgeIndex === -1) return
|
||||
deleteOutgoingEdgeIdProps(typebot, edgeIndex)
|
||||
typebot.edges.splice(edgeIndex, 1)
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
if (req.method === 'GET') {
|
||||
const credentialsId = req.query.credentialsId.toString()
|
||||
const auth = await getAuthenticatedGoogleClient(user.id, credentialsId)
|
||||
const { data } = await drive({
|
||||
const response = await drive({
|
||||
version: 'v3',
|
||||
auth,
|
||||
}).files.list({
|
||||
q: "mimeType='application/vnd.google-apps.spreadsheet'",
|
||||
fields: 'nextPageToken, files(id, name)',
|
||||
})
|
||||
return res.send(data)
|
||||
return res.send(response.data)
|
||||
}
|
||||
return methodNotAllowed(res)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user