Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Change fetchDatabaseListByPrincipalId to fetchDatabaseList

天舟dd3972f8aac0
diff --git a/frontend/src/components/DatabaseListSidePanel.vue b/frontend/src/components/DatabaseListSidePanel.vue
index 26bb97e4c5..9b5b23a033 100644
--- a/frontend/src/components/DatabaseListSidePanel.vue
+++ b/frontend/src/components/DatabaseListSidePanel.vue
@@ -33,10 +33,7 @@ export default {
const prepareDatabaseList = () => {
// It will also be called when user logout
if (currentUser.value.id != UNKNOWN_ID) {
- store.dispatch(
- "database/fetchDatabaseListByPrincipalId",
- currentUser.value.id
- );
+ store.dispatch("database/fetchDatabaseList");
}
};
diff --git a/frontend/src/store/modules/database.ts b/frontend/src/store/modules/database.ts
index ea14ba9825..a71ddd0ddf 100644
--- a/frontend/src/store/modules/database.ts
+++ b/frontend/src/store/modules/database.ts
@@ -231,11 +231,9 @@ const actions = {
return databaseList;
},
- async fetchDatabaseListByPrincipalId(
- { commit, rootGetters }: any,
- userId: PrincipalId
- ) {
- const data = (await axios.get(`/api/database?user=${userId}`)).data;
+ // Server uses the caller identity to fetch the database list related to the caller.
+ async fetchDatabaseList({ commit, rootGetters }: any) {
+ const data = (await axios.get(`/api/database`)).data;
const databaseList = data.data.map((database: ResourceObject) => {
return convert(database, data.included, rootGetters);
});
diff --git a/frontend/src/views/DatabaseDashboard.vue b/frontend/src/views/DatabaseDashboard.vue
index 1710cd5a27..fe66971625 100644
--- a/frontend/src/views/DatabaseDashboard.vue
+++ b/frontend/src/views/DatabaseDashboard.vue
@@ -94,14 +94,9 @@ export default {
const prepareDatabaseList = () => {
// It will also be called when user logout
if (currentUser.value.id != UNKNOWN_ID) {
- store
- .dispatch(
- "database/fetchDatabaseListByPrincipalId",
- currentUser.value.id
- )
- .then((list) => {
- state.databaseList = sortDatabaseList(list, environmentList.value);
- });
+ store.dispatch("database/fetchDatabaseList").then((list) => {
+ state.databaseList = sortDatabaseList(list, environmentList.value);
+ });
}
};