diff --git a/src/components/ScreenTemplates.vue b/src/components/ScreenTemplates.vue index 4f9446da5..ab477e95a 100644 --- a/src/components/ScreenTemplates.vue +++ b/src/components/ScreenTemplates.vue @@ -38,6 +38,9 @@ data-cy="my-templates-list" > + + + + + + { - this.myTemplatesData = response.data.data; - if (this.myTemplatesData.length === 0 || this.myTemplatesData === undefined) { - this.noMyTemplatesFound = true; + .get( + `templates/screen?is_public=0&screen_type=${this.screenType}`, + ) + .then((response) => { + this.myTemplatesData = response.data.data; + if (this.myTemplatesData.length === 0 || this.myTemplatesData === undefined) { + this.noMyTemplatesFound = true; } }) .catch((error) => { console.error(error); + }) + .finally(() => { + this.loading = false; }); }, fetchSharedTemplates() { - ProcessMaker.apiClient - .get( - `templates/screen?is_public=1&screen_type=${this.screenType}`, - ) - .then((response) => { - this.sharedTemplatesData = response.data.data; - if (this.sharedTemplatesData.length === 0 || this.sharedTemplatesData === undefined) { - this.noSharedTemplatesFound = true; - } - }) - .catch((error) => { - console.error(error); - }); + this.loading = true; + ProcessMaker.apiClient + .get( + `templates/screen?is_public=1&screen_type=${this.screenType}`, + ) + .then((response) => { + this.sharedTemplatesData = response.data.data; + if (this.sharedTemplatesData.length === 0 || this.sharedTemplatesData === undefined) { + this.noSharedTemplatesFound = true; + } + }) + .catch((error) => { + console.error(error); + }) + .finally(() => { + this.loading = false; + }); }, showSharedTemplates() { this.myTemplatesSelected = false;