Don't request summaries in ProjectList.

Those will be populated directly by Vuex.
This commit is contained in:
D. Berge
2025-08-20 12:05:44 +02:00
parent faf7e9c98f
commit 7d8c78648d

View File

@@ -189,19 +189,20 @@ export default {
...mapGetters(['loading', 'projects'])
},
watch: {
async projects () {
await this.load();
}
},
methods: {
async list () {
this.items = [...this.projects];
},
async summary (item) {
const details = await this.api([`/project/${item.pid}/summary`]);
if (details) {
return Object.assign({}, details, item);
}
},
title (item) {
if (item.organisations) {
return "Access:\n" + Object.entries(item.organisations).map( org =>
@@ -212,30 +213,22 @@ export default {
},
async load () {
await this.refreshProjects();
if (!this.projects.length) {
this.refreshProjects();
}
await this.list();
const promises = [];
for (const key in this.items) {
const item = this.items[key];
const promise = this.summary(item)
.then( expanded => {
if (expanded) {
this.$set(this.items, key, expanded);
}
});
promises.push(promise);
},
handlerLoad (context, {payload}) {
if (payload?.table == "public") {
this.load();
}
},
registerNotificationHandlers () {
this.$store.dispatch('registerHandler', {
table: 'project`',
handler: (context, message) => {
if (message.payload?.table == "public") {
this.load();
}
}
handler: this.handlerLoad
});
},