Skip to content

Commit ba23f2f

Browse files
joshenlimzamotany
andauthored
Fix restart DB TS error (supabase#38256)
* Fix restart DB TS error * Update apps/studio/components/interfaces/Settings/General/Infrastructure/RestartServerButton.tsx Co-authored-by: Paweł Gulbinowicz <[email protected]> --------- Co-authored-by: Paweł Gulbinowicz <[email protected]>
1 parent ad9aa0e commit ba23f2f

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

apps/studio/data/projects/projects-query.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,20 @@ export function setProjectStatus(
8181
projectRef: Project['ref'],
8282
status: Project['status']
8383
) {
84-
client.setQueriesData<Project[] | undefined>(
84+
client.setQueriesData<PaginatedProjectsResponse | undefined>(
8585
projectKeys.list(),
8686
(old) => {
8787
if (!old) return old
8888

89-
return old.map((project) => {
90-
if (project.ref === projectRef) {
91-
return { ...project, status }
92-
}
93-
return project
94-
})
89+
return {
90+
...old,
91+
projects: old.projects.map((project) => {
92+
if (project.ref === projectRef) {
93+
return { ...project, status }
94+
}
95+
return project
96+
}),
97+
}
9598
},
9699
{ updatedAt: Date.now() }
97100
)

0 commit comments

Comments
 (0)