The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Add onOrgJoined to update orgs after joining
Terry Suttone6e57cd9f806
diff --git a/studio/pages/join/index.tsx b/studio/pages/join/index.tsxindex dd0c93426ab..a2e5c416409 100644--- a/studio/pages/join/index.tsx+++ b/studio/pages/join/index.tsx@@ -62,6 +62,7 @@ const JoinOrganizationPage = () => {async function handleJoinOrganization() {setIsSubmitting(true)const response = await post(`${API_URL}/organizations/${slug}/members/join?token=${token}`, {})+if (response.error) {ui.setNotification({category: 'error',@@ -70,7 +71,7 @@ const JoinOrganizationPage = () => {setIsSubmitting(false)} else {setIsSubmitting(false)- app.organizations.load()+ app.onOrgJoined(response)router.push('/')}}diff --git a/studio/stores/app/AppStore.ts b/studio/stores/app/AppStore.tsindex e66507d00af..a8e774b8592 100644--- a/studio/stores/app/AppStore.ts+++ b/studio/stores/app/AppStore.ts@@ -18,6 +18,7 @@ export interface IAppStore {onProjectStatusUpdated: (projectId: number, value: string) => voidonProjectPostgrestStatusUpdated: (projectId: number, value: 'OFFLINE' | 'ONLINE') => voidonOrgAdded: (org: any) => void+ onOrgJoined: (org: any) => voidonOrgUpdated: (org: any) => voidonOrgDeleted: (org: any) => void}@@ -104,6 +105,12 @@ export default class AppStore implements IAppStore {}}+ onOrgJoined(org: Organization) {+ if (org && org.id) {+ this.organizations.data[org.id] = org+ }+ }+onOrgDeleted(org: Organization) {if (org && org.id) {const projects = values(this.projects.data)