Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Fix pitr button not firign

Joshen Lim8be5f87e0ce6
diff --git a/studio/components/interfaces/Database/Backups/PITRBackupSelection/index.tsx b/studio/components/interfaces/Database/Backups/PITRBackupSelection/index.tsx
index d14864827ac..416cfce7beb 100644
--- a/studio/components/interfaces/Database/Backups/PITRBackupSelection/index.tsx
+++ b/studio/components/interfaces/Database/Backups/PITRBackupSelection/index.tsx
@@ -268,7 +268,9 @@ const PITRBackupSelection: FC<Props> = () => {
</div>
<Popover.Seperator />
<div className="flex items-center justify-end px-4">
- <Button type="default">Restore</Button>
+ <Button type="default" htmlType="submit">
+ Restore
+ </Button>
</div>
</div>
</div>
diff --git a/studio/hooks/queries/useProjectUsageStatus.ts b/studio/hooks/queries/useProjectUsageStatus.ts
new file mode 100644
index 00000000000..1d235271b86
--- /dev/null
+++ b/studio/hooks/queries/useProjectUsageStatus.ts
@@ -0,0 +1,16 @@
+import useSWR from 'swr'
+import { get } from 'lib/common/fetch'
+import { API_URL } from 'lib/constants'
+
+export function useProjectUsageStatus(ref: string) {
+ const url = `${API_URL}/projects/${ref}/usage-status`
+ const { data, error } = useSWR<any>(url, get)
+ const anyError = data?.error || error
+
+ return {
+ config: anyError ? undefined : data,
+ error: anyError,
+ isLoading: !anyError && !data,
+ isError: !!anyError,
+ }
+}