Skip to content

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

Sorting the VCS list in creation time DESC on saving intead of reading

天舟be481736d6ea
diff --git a/frontend/src/store/modules/vcs.ts b/frontend/src/store/modules/vcs.ts
index 2f1cd3f1d7..9432551023 100644
--- a/frontend/src/store/modules/vcs.ts
+++ b/frontend/src/store/modules/vcs.ts
@@ -43,9 +43,7 @@ const getters = {
for (const [_, vcs] of state.vcsById) {
list.push(vcs);
}
- return list.sort((a: VCS, b: VCS) => {
- return b.createdTs - a.createdTs;
- });
+ return list;
},
vcsById:
@@ -63,9 +61,13 @@ const actions = {
async fetchVCSList({ commit }: any) {
const path = "/api/vcs";
const data = (await axios.get(path)).data;
- const vcsList = data.data.map((vcs: ResourceObject) => {
- return convert(vcs);
- });
+ const vcsList = data.data
+ .map((vcs: ResourceObject) => {
+ return convert(vcs);
+ })
+ .sort((a: VCS, b: VCS) => {
+ return b.createdTs - a.createdTs;
+ });
commit("setVCSList", vcsList);