Skip to content

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

fix: fetch changelist (#15609)

ecmadaoe5ebb9078237
diff --git a/frontend/src/components/Changelist/ChangelistDetail/context.ts b/frontend/src/components/Changelist/ChangelistDetail/context.ts
index e4a8af9371..8313aa0267 100644
--- a/frontend/src/components/Changelist/ChangelistDetail/context.ts
+++ b/frontend/src/components/Changelist/ChangelistDetail/context.ts
@@ -11,7 +11,7 @@ import {
} from "@/store";
import { projectNamePrefix } from "@/store/modules/v1/common";
import type { ComposedProject, Permission } from "@/types";
-import { unknownChangelist, unknownProject } from "@/types";
+import { unknownChangelist, unknownProject, isValidProjectName } from "@/types";
import type {
Changelist,
Changelist_Change as Change,
@@ -66,17 +66,27 @@ export const provideChangelistDetailContext = () => {
return proj;
}, unknownProject());
- const name = computed(() => {
+ const changelistName = computed(() => {
+ if (!isValidProjectName(project.value.name)) {
+ return;
+ }
return `${project.value.name}/changelists/${route.params.changelistName}`;
});
watchEffect(async () => {
- await useChangelistStore().fetchChangelistByName(name.value);
+ if (changelistName.value) {
+ await useChangelistStore().getOrFetchChangelistByName(
+ changelistName.value
+ );
+ }
});
const changelist = computed(() => {
+ if (!changelistName.value) {
+ return unknownChangelist();
+ }
return (
- useChangelistStore().getChangelistByName(name.value) ??
+ useChangelistStore().getChangelistByName(changelistName.value) ??
unknownChangelist()
);
});
diff --git a/frontend/src/store/modules/v1/changelist.ts b/frontend/src/store/modules/v1/changelist.ts
index 625a6cf4d1..deef31266d 100644
--- a/frontend/src/store/modules/v1/changelist.ts
+++ b/frontend/src/store/modules/v1/changelist.ts
@@ -113,7 +113,6 @@ export const useChangelistStore = defineStore("changelist", () => {
return {
getChangelistByName,
- fetchChangelistByName,
getOrFetchChangelistByName,
createChangelist,
fetchChangelists,