Fix dataset list operation to switch between histories

This commit is contained in:
guerler
2022-08-04 14:59:18 -04:00
committed by Dannon Baker
parent 6dec9a04bf
commit f2742831e3
3 changed files with 9 additions and 21 deletions
+8 -10
View File
@@ -28,6 +28,7 @@
</div>
</template>
<script>
import store from "store";
import { getAppRoot } from "onload/loadConfig";
import { getGalaxyInstance } from "app";
import { Services } from "./services";
@@ -147,16 +148,13 @@ export default {
this.onError(error);
});
},
onShowDataset(item) {
const Galaxy = getGalaxyInstance();
this.services
.setHistory(item.history_id)
.then(() => {
Galaxy.currHistoryPanel.loadCurrentHistory();
})
.catch((error) => {
this.onError(error);
});
async onShowDataset(item) {
const historyId = item.history_id;
try {
await store.dispatch("history/setCurrentHistory", historyId);
} catch (error) {
this.onError(error);
}
},
onTags(tags, index) {
const item = this.rows[index];
-10
View File
@@ -45,16 +45,6 @@ export class Services {
}
}
async setHistory(id) {
const url = `${this.root}history/set_as_current?id=${id}`;
try {
const response = await axios.get(url);
return response.data;
} catch (e) {
this._errorMessage(e);
}
}
async updateTags(item_id, item_class, item_tags) {
const url = `${this.root}api/tags`;
try {
@@ -153,7 +153,7 @@ const actions = {
},
async setCurrentHistory({ dispatch, getters }, id) {
const changedHistory = await setCurrentHistoryOnServer(id);
dispatch("selectHistory", changedHistory);
return dispatch("selectHistory", changedHistory);
},
setHistory({ commit }, history) {
commit("setHistory", history);