diff --git a/resources/js/processes/designer/RecentAssetsList.vue b/resources/js/processes/designer/RecentAssetsList.vue
index 62ffe90dd8..ace666c9e8 100644
--- a/resources/js/processes/designer/RecentAssetsList.vue
+++ b/resources/js/processes/designer/RecentAssetsList.vue
@@ -4,7 +4,7 @@
@@ -15,8 +15,7 @@
@@ -177,32 +175,31 @@ export default {
* get data for Recent Assets
*/
fetch(pmql = "") {
- if (this.project) {
- this.loading = true;
- this.apiDataLoading = true;
- let url = "projects/assets/recent?";
- // Load from our api client
- window.ProcessMaker.apiClient
- .get(
- url +
- "asset_types=" +
- this.types +
- "&pmql=" +
- encodeURIComponent(pmql) +
- "&order_by=" +
- this.orderBy +
- "&order_direction=" +
- this.orderDirection,
- )
- .then((response) => {
- this.data = this.transform(response.data);
- this.apiDataLoading = false;
- this.loading = false;
- }).catch((error) => {
- ProcessMaker.alert(error.response?.data?.message, "danger");
- this.data = [];
- });
- }
+ if (!this.project) return;
+
+ this.loading = true;
+ this.apiDataLoading = true;
+
+ const params = new URLSearchParams({
+ asset_types: this.types,
+ pmql,
+ order_by: this.orderBy,
+ order_direction: this.orderDirection,
+ });
+
+ window.ProcessMaker.apiClient
+ .get(`projects/assets/recent?${params}`)
+ .then((response) => {
+ this.data = this.transform(response.data);
+ })
+ .catch((error) => {
+ ProcessMaker.alert(error.response?.data?.message, "danger");
+ this.data = [];
+ })
+ .finally(() => {
+ this.apiDataLoading = false;
+ this.loading = false;
+ });
},
/**
* reload page
@@ -316,7 +313,7 @@ export default {
* open modal to PM Block
*/
showPmBlockModal(name, id) {
- this.processId = id;
+ this.assetId = id;
this.pmBlockName = name;
this.$refs["create-pm-block-modal"].show();
},