The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
fix: Refetch project details when reseting the database password (#21053)
Ivan Vasilova18c11807de5
diff --git a/apps/studio/data/database/database-password-reset-mutation.ts b/apps/studio/data/database/database-password-reset-mutation.tsindex c6f6a7df9e4..fef0e3c6fb3 100644--- a/apps/studio/data/database/database-password-reset-mutation.ts+++ b/apps/studio/data/database/database-password-reset-mutation.ts@@ -1,7 +1,8 @@-import { useMutation, UseMutationOptions } from '@tanstack/react-query'+import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'import { toast } from 'react-hot-toast'import { patch } from 'data/fetchers'+import { projectKeys } from 'data/projects/keys'import { ResponseError } from 'types'export type DatabasePasswordResetVariables = {@@ -31,10 +32,14 @@ export const useDatabasePasswordResetMutation = ({UseMutationOptions<DatabasePasswordResetData, ResponseError, DatabasePasswordResetVariables>,'mutationFn'> = {}) => {+ const queryClient = useQueryClient()+return useMutation<DatabasePasswordResetData, ResponseError, DatabasePasswordResetVariables>((vars) => resetDatabasePassword(vars),{async onSuccess(data, variables, context) {+ await queryClient.invalidateQueries(projectKeys.detail(variables.ref))+await onSuccess?.(data, variables, context)},async onError(data, variables, context) {